added -j, join | mounts aditional folder into the union
[pandora-libraries.git] / testdata / scripts / pnd_run.sh
index 24cd9b2..38af244 100755 (executable)
@@ -19,7 +19,7 @@
 #cleanup
  
 # parse arguments
-TEMP=`getopt -o p:e:a:b:s:m::u::n::x:: -- "$@"`
+TEMP=`getopt -o p:e:a:b:s:m::u::n::x: -- "$@"`
  
 if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
  
@@ -36,6 +36,7 @@ while true ; do
                -m) echo "mount";mount=1;shift 2;;
                -u) echo "umount";umount=1;shift 2;;
                -x) echo "no x";nox=1;shift 2;;
+               -j) echo "join/ also mount those folders";append=$2;shift 2;;
                -a) 
                        case "$2" in
                                "") echo "no arguments"; shift 2 ;;
@@ -70,7 +71,7 @@ if [ $nox ]; then #the app doesnt want x to run, so we kill it and restart it on
                if [ $? = 102 ]; then
                exit 1
                fi
-               sudo /etc/init.d/slim stop
+               sudo /etc/init.d/slim-init stop
                sleep 5s
        else
                echo -e “ae[34me[30m”
@@ -79,7 +80,7 @@ if [ $nox ]; then #the app doesnt want x to run, so we kill it and restart it on
                exit 1
                fi
                # close x now, do we want to use slim stop or just kill x?
-               sudo /etc/init.d/slim stop
+               sudo /etc/init.d/slim-init stop
                sleep 5s
        fi
 fi
@@ -155,10 +156,11 @@ if [ ! $umount ]; then
                echo "$mntline"
                $mntline #mount the pnd/folder
                echo "mounting union!"
-               if [ $FILESYSTEM = vfat ]; then # use noplink on fat, dont on other fs's
-               sudo mount -t aufs -o exec,noplink,dirs=$MOUNTPOINT/pandora/appdata/$BASENAME=rw+nolwh:/mnt/pnd/$BASENAME=rr none /mnt/utmp/$BASENAME # put union on top
+               if [ $FILESYSTEM = vfat ]; then # use noplink on fat, dont on other fs's 
+               #append is fucking dirty, need to clean that up
+               sudo mount -t aufs -o exec,noplink,dirs=$MOUNTPOINT/pandora/appdata/$BASENAME=rw+nolwh:/mnt/pnd/$BASENAME=rr$append none /mnt/utmp/$BASENAME # put union on top
                else
-               sudo mount -t aufs -o exec,dirs=$MOUNTPOINT/pandora/appdata/$BASENAME=rw+nolwh:/mnt/pnd/$BASENAME=rr none /mnt/utmp/$BASENAME # put union on top
+               sudo mount -t aufs -o exec,dirs=$MOUNTPOINT/pandora/appdata/$BASENAME=rw+nolwh:/mnt/pnd/$BASENAME=rr$append none /mnt/utmp/$BASENAME # put union on top
                fi
  
        else
@@ -208,5 +210,5 @@ fi
 if [ $nox ]; then #restart x if it was killed
 echo "starting x in 5s"
 sleep 5
-sudo /etc/init.d/slim start
+sudo /etc/init.d/slim-init-init start
 fi