From: skeezix Date: Wed, 10 Mar 2010 17:30:26 +0000 (-0500) Subject: Fixed pnd_run.sh so -m and -u work, yay for previewpics X-Git-Tag: Release-2010-05/1~65 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55ac63ab6506ac8ed34af907e99cc09787a10bd3;p=pandora-libraries.git Fixed pnd_run.sh so -m and -u work, yay for previewpics --- diff --git a/minimenu/TODO.txt b/minimenu/TODO.txt index 0217f65..690df18 100644 --- a/minimenu/TODO.txt +++ b/minimenu/TODO.txt @@ -9,7 +9,6 @@ - manual app rescan - conf: use real app searchpaths - About screen -- redraw after deferred preview load - deploy.. - .desktop for deply diff --git a/testdata/scripts/pnd_run.sh b/testdata/scripts/pnd_run.sh index e59d73d..37ef213 100644 --- a/testdata/scripts/pnd_run.sh +++ b/testdata/scripts/pnd_run.sh @@ -48,7 +48,7 @@ while true ; do *) echo "Error while parsing arguments!" ; exit 1 ;; esac done - + if [ ! $PND ]; then #check if theres a pnd suplied, need to clean that up a bit more echo "Usage: pnd_run.sh -p your.pnd -e executeable [-a \"(arguments)\"] [ -s \"cd to folder inside pnd\"] [-b UID (name of mountpoint/pandora/appdata)] [-x close x before launching(script needs to be started with nohup for this to work]" exit 1 @@ -61,6 +61,10 @@ if [ ! $EXENAME ]; then fi fi +if [ $(pidof X) ]; then +unset $nox +fi + fork () { echo in fork! if [ $nox ]; then #the app doesnt want x to run, so we kill it and restart it once the app quits @@ -211,6 +215,7 @@ fi #clean up sudo rmdir /mnt/utmp/$BASENAME +sudo rm /mnt/utmp/$BASENAME sudo umount /mnt/utmp/$BASENAME #umount union if [ $? -eq 0 ]; then # check if the umount was successfull, if it wasnt it would mean that theres still something running so we skip this stuff, this WILL lead to clutter if it happens, so we should make damn sure it never happens #umount the actual pnd @@ -221,9 +226,9 @@ if [ $? -eq 0 ]; then # check if the umount was successfull, if it wasnt it woul #delete appdata folder and ancestors if empty sudo rmdir -p $MOUNTPOINT/pandora/appdata/$BASENAME/ #delete tmp mountpoint - sudo rmdir /mnt/utmp/$BASENAME; + sudo rmdir /mnt/utmp/$BASENAME if [ $DFS = ISO ] || [ $DFS = Squashfs ]; then # check if we where running an iso, clean up loop device if we did - LOOP=$(sudo losetup -a | grep $PND | tail -n1 | awk -F: '{print $1}') + LOOP=$(sudo losetup -a | grep $(basename $PND) | tail -n1 | awk -F: '{print $1}') sudo /sbin/losetup -d $LOOP sudo rm $LOOP fi @@ -243,9 +248,9 @@ fi if [ $nox ]; then echo forking now! -fork &> /tmp/pndrun$BASENAME.out & +fork &> /tmp/pndrun$BASENAME$mount.out & disown else echo Running with x, not disowning! -fork &> /tmp/pndrun$BASENAME.out +fork &> /tmp/pndrun$BASENAME$mount.out fi \ No newline at end of file