diff --git a/rm-sync.sh b/rm-sync.sh index 82df977..c152bcd 100755 --- a/rm-sync.sh +++ b/rm-sync.sh @@ -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 Specify the username (default: root)" echo " --host 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 -echo "Restarting xochitl" -ssh "$user@$host" systemctl restart xochitl +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"