From: Michael Mrozek Date: Wed, 30 Apr 2014 00:02:04 +0000 (+0200) Subject: op_switchgui.sh: Exits the script when no selection was made (instead of dropping... X-Git-Tag: sz_161^0 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=openpandora.oe.git;a=commitdiff_plain;h=09d2370a8a5dac7c8f50067d6c70d12f854368d6 op_switchgui.sh: Exits the script when no selection was made (instead of dropping the user to the login screen) --- diff --git a/recipes/pandora-system/pandora-scripts.bb b/recipes/pandora-system/pandora-scripts.bb index 1046464..0c668ca 100644 --- a/recipes/pandora-system/pandora-scripts.bb +++ b/recipes/pandora-system/pandora-scripts.bb @@ -5,7 +5,7 @@ COMPATIBLE_MACHINE = "omap3-pandora" RDEPENDS = "bash sed gawk grep zenity" -PR = "r158" +PR = "r159" SRC_URI = " \ file://op_bright.sh \ diff --git a/recipes/pandora-system/pandora-scripts/op_switchgui.sh b/recipes/pandora-system/pandora-scripts/op_switchgui.sh index 27eb61f..d342a06 100755 --- a/recipes/pandora-system/pandora-scripts/op_switchgui.sh +++ b/recipes/pandora-system/pandora-scripts/op_switchgui.sh @@ -3,16 +3,22 @@ selection=$(cat /etc/pandora/conf/gui.conf | grep -v NOSWITCH | awk -F\; '{print $1 "\n" $2 }' | zenity --width=500 --height=300 --title="Switch to a different GUI" --list --column "name" --column "description" --text "Select a GUI you want to switch to" ) echo $selection -gui=$(grep $selection /etc/pandora/conf/gui.conf | awk -F\; '{print $3}') -stopnew=$(grep $selection /etc/pandora/conf/gui.conf | awk -F\; '{print $4}') +if [ $selection ]; then -echo $gui + gui=$(grep $selection /etc/pandora/conf/gui.conf | awk -F\; '{print $3}') + stopnew=$(grep $selection /etc/pandora/conf/gui.conf | awk -F\; '{print $4}') -if [ $gui ]; then - echo "$gui" > /tmp/gui.load - echo "$stopnew" > /tmp/gui.stopnew - echo $selection will be started - /tmp/gui.stop + echo $gui + + if [ $gui ]; then + echo "$gui" > /tmp/gui.load + echo "$stopnew" > /tmp/gui.stopnew + echo $selection will be started + /tmp/gui.stop + else + exit 0 + fi else + echo "Nothing selected." exit 0 -fi \ No newline at end of file +fi