feat: add option to reboot instead of reload xochitl
This commit is contained in:
parent
77700568df
commit
ea4a6d94fe
1 changed files with 10 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ set -euo pipefail
|
|||
|
||||
user="root"
|
||||
host="10.11.99.1"
|
||||
reboot=0
|
||||
|
||||
args=()
|
||||
|
||||
|
|
@ -12,6 +13,7 @@ print_help() {
|
|||
echo "Options:"
|
||||
echo " --user <username> Specify the username (default: root)"
|
||||
echo " --host <hostname> Specify the host (default: 10.11.99.1)"
|
||||
echo " --reboot Reboot the device instead of reloading the UI"
|
||||
echo " --help, -h Display this help message"
|
||||
echo ""
|
||||
echo "PDF files:"
|
||||
|
|
@ -23,6 +25,7 @@ while [[ "$#" -gt 0 ]]; do
|
|||
--user) user="$2"; shift ;;
|
||||
--host) host="$2"; shift ;;
|
||||
--help|-h) print_help; exit 0 ;;
|
||||
--reboot) reboot=1 ;;
|
||||
*) args+=("$1") ;;
|
||||
esac
|
||||
shift
|
||||
|
|
@ -110,6 +113,11 @@ for pdf_fname in "$@"; do
|
|||
process_pdf "$pdf_fname"
|
||||
done
|
||||
|
||||
if [[ reboot -eq 1 ]]; then
|
||||
echo "Rebooting device"
|
||||
ssh "$user@$host" systemctl reboot
|
||||
else
|
||||
echo "Restarting xochitl"
|
||||
ssh "$user@$host" systemctl restart xochitl
|
||||
fi
|
||||
echo "Done"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue