Code Sample |
echo -n "${BLUE}Checking for myDSL apps... ${NORMAL}" if checkbootparam "mydsl"; then CKMYDSL="yes" fi >> MYDSL_DIR="" >> MYDSL_DIR="$(getbootparam 'mydsl_dir')" if checkbootparam "toram"; then TORAM="yes" mount -t iso9660 /dev/cdrom /cdrom2 > /dev/null 2>&1 >> getmydslapps "/cdrom2$MYDSL_DIR" umount /cdrom2 else >> getmydslapps "/cdrom$MYDSL_DIR" fi MYDSL="$(getbootparam 'mydsl')" if [ ! -z "$MYDSL" ]; then MYDSL="/mnt/$MYDSL" echo "$MYDSL" > /etc/sysconfig/mydsl.mount mount "$MYDSL" if [ $? == 0 ]; then UMOUNT="yes" >> getmydslapps "$MYDSL$MYDSL_DIR" if [ "$UMOUNT" == "yes" ]; then umount "$MYDSL" fi fi fi |
Code Sample |
MYDSL_DIR="" mkmydslmenu(){ MYMENU="/var/tmp/mydsl.menu" if [ -d "$MYMENU" ]; then DSLMENU="$HOME/.fluxbox/menu" WORK="/var/tmp/menu.$$" CNT=$(wc -l "$DSLMENU"|awk '{print $1}') RESTOFIT=`expr "$CNT" - 2` head -2 "$DSLMENU" > /"$WORK" echo " [submenu] (myDSL-$MYDSL_DIR) {}" >> "$WORK" for FILE in `ls $MYMENU/ 2>/dev/null` do cat "$MYMENU/$FILE" >> /"$WORK" done echo " [end]" >> "$WORK" tail -"$RESTOFIT" "$DSLMENU" >> "$WORK" mv "$WORK" "$DSLMENU" rm -rf "$MYMENU" fi return 0 } # Reread boot command line; echo last parameter's argument or return false. getbootparams(){ stringinstring " $1=" "$CMDLINE" || return 1 result="${CMDLINE##*$1=(}" result="${result%%[)]*}" echo "$result" return 0 } ### END functions HOME="/home/dsl" INSTALLED="" TORAM="" CKMYDSL="" CMDLINE="$(cat /proc/cmdline)" echo -n "${BLUE}Checking for myDSL apps... ${NORMAL}" if checkbootparam "mydsl"; then CKMYDSL="yes" fi if checkbootparam "mydsl_dir"; then MYDSL_DIRS="$(getbootparams 'mydsl_dir')" echo $MYDSL_DIRS for MYDSL_DIR in $MYDSL_DIRS do if checkbootparam "toram"; then TORAM="yes" mount -t iso9660 /dev/cdrom /cdrom2 > /dev/null 2>&1 # getmydslapps "/cdrom2" getmydslapps "/cdrom2$MYDSL_DIR" umount /cdrom2 else # getmydslapps "/cdrom" getmydslapps "/cdrom$MYDSL_DIR" fi MYDSL="$(getbootparam 'mydsl')" if [ ! -z "$MYDSL" ]; then MYDSL="/mnt/$MYDSL" echo "$MYDSL" > /etc/sysconfig/mydsl.mount mount "$MYDSL" if [ $? == 0 ]; then UMOUNT="yes" # getmydslapps "$MYDSL" getmydslapps "$MYDSL$MYDSL_DIR" if [ "$UMOUNT" == "yes" ]; then umount "$MYDSL" fi fi fi mkmydslmenu done echo " ${BLUE}Done. ${NORMAL}" else echo " ${BLUE}None. ${NORMAL}" fi |
Code Sample |
ebian MENU [begin] (DSL) [submenu] (myDSL-/dir2) {} [submenu](Install Optional Extensions){} [exec](bittorrent){/usr/bin/mydsl-load /cdrom/dsl-wendy/optional/bittorrent.dsl} [end] [end] [submenu] (myDSL-/dir1) {} [exec] (AbiWord) {/opt/abiword/abiword} [exec] (MPlayer) {/usr/bin/gmplayer} [submenu](Install Optional Extensions){} [exec](samba){/usr/bin/mydsl-load /cdrom/dsl-henk/optional/samba.dsl} [end] [end] [submenu] (myDSL) {} [exec] (FireFox) {/opt/firefox/firefox} [exec] (Amsn) {/usr/bin/amsn} [exec] (Aterm) {/opt/aterm/dsl-aterm} [submenu](Install Optional Extensions){} [exec](nmap){/usr/bin/mydsl-load /cdrom/optional/nmap.dsl} [end] [exec] (Rox Filer) {/opt/.start_rox} [submenu] (tcltk) {} [exec] (tclsh) {rxvt -rv -fn fixed -T "tclsh8.3" -e /bin/tclsh8.3} [exec] (wish) {rxvt -rv -fn fixed -T "wish8.3" -e /bin/wish8.3} [end] [end] [submenu] (Apps) {} [submenu] (Editors) {} ..... |