From a2006173780c382153fd079fcc7ac353226ea1f6 Mon Sep 17 00:00:00 2001 From: Grazvydas Ignotas Date: Mon, 20 Oct 2014 02:19:03 +0300 Subject: [PATCH] pnd_run.sh: restore nub settings on last pnd exit For misbehaving PNDs. Idea by LinuxSwat. --- testdata/scripts/pnd_run.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/testdata/scripts/pnd_run.sh b/testdata/scripts/pnd_run.sh index ab02b26..c6cdc9b 100755 --- a/testdata/scripts/pnd_run.sh +++ b/testdata/scripts/pnd_run.sh @@ -626,6 +626,17 @@ main() { ofbset -fb /dev/fb1 -mem 0 -size 0 0 -en 0 fi PND_EndTask + + running_pnd_count=$(ps ax | grep "pnd_run.s[h]" | wc -l) + # restore settings if we are the last exiting pnd + # compare with 2 because one is used by subshell where "ps ax | ..." runs + if [ "$running_pnd_count" -eq "2" ]; then + PND_BeginTask "Restoring nub mode" + sed -n '1p' /etc/pandora/conf/nubs.state > /proc/pandora/nub0/mode + sed -n '7p' /etc/pandora/conf/nubs.state > /proc/pandora/nub1/mode + PND_EndTask + fi + PND_BeginTask "uMount the PND" umountUnion PND_EndTask -- 2.39.5