mirror of
https://github.com/Manuel83/craftbeerpi3
synced 2026-09-19 07:49:08 +02:00
Added a combinaton of stop-del logfiles-start
This one makes it easier to test plugins.
This commit is contained in:
+14
-2
@@ -19,7 +19,8 @@ show_menu () {
|
|||||||
"7" "Software Update (git pull)" \
|
"7" "Software Update (git pull)" \
|
||||||
"8" "Reset File Changes (git reset --hard)" \
|
"8" "Reset File Changes (git reset --hard)" \
|
||||||
"9" "Clear all logs" \
|
"9" "Clear all logs" \
|
||||||
"10" "Reboot Raspberry Pi" 3>&1 1>&2 2>&3)
|
"10" "Reboot Raspberry Pi" \
|
||||||
|
"11" "Stop CraftBeerPi, Clear logs, Start CraftBeerPi" 3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
BUTTON=$?
|
BUTTON=$?
|
||||||
# Exit if user pressed cancel or escape
|
# Exit if user pressed cancel or escape
|
||||||
@@ -136,13 +137,24 @@ show_menu () {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
10)
|
10)
|
||||||
confirmAnswer "Are you sure you want to reboo the Raspberry Pi?"
|
confirmAnswer "Are you sure you want to reboot the Raspberry Pi?"
|
||||||
if [ $? = 0 ]; then
|
if [ $? = 0 ]; then
|
||||||
sudo reboot
|
sudo reboot
|
||||||
else
|
else
|
||||||
show_menu
|
show_menu
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
11)
|
||||||
|
confirmAnswer "Are you sure you want to reboot CraftBeerPi and delete all log files?"
|
||||||
|
if [ $? = 0 ]; then
|
||||||
|
sudo /etc/init.d/craftbeerpiboot stop
|
||||||
|
sudo rm -rf logs/*.log
|
||||||
|
sudo /etc/init.d/craftbeerpiboot start
|
||||||
|
show_menu
|
||||||
|
else
|
||||||
|
show_menu
|
||||||
|
fi
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user