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
12
rm-sync.sh
12
rm-sync.sh
|
|
@ -3,6 +3,7 @@ set -euo pipefail
|
||||||
|
|
||||||
user="root"
|
user="root"
|
||||||
host="10.11.99.1"
|
host="10.11.99.1"
|
||||||
|
reboot=0
|
||||||
|
|
||||||
args=()
|
args=()
|
||||||
|
|
||||||
|
|
@ -12,6 +13,7 @@ print_help() {
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
echo " --user <username> Specify the username (default: root)"
|
echo " --user <username> Specify the username (default: root)"
|
||||||
echo " --host <hostname> Specify the host (default: 10.11.99.1)"
|
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 " --help, -h Display this help message"
|
||||||
echo ""
|
echo ""
|
||||||
echo "PDF files:"
|
echo "PDF files:"
|
||||||
|
|
@ -23,6 +25,7 @@ while [[ "$#" -gt 0 ]]; do
|
||||||
--user) user="$2"; shift ;;
|
--user) user="$2"; shift ;;
|
||||||
--host) host="$2"; shift ;;
|
--host) host="$2"; shift ;;
|
||||||
--help|-h) print_help; exit 0 ;;
|
--help|-h) print_help; exit 0 ;;
|
||||||
|
--reboot) reboot=1 ;;
|
||||||
*) args+=("$1") ;;
|
*) args+=("$1") ;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
|
|
@ -110,6 +113,11 @@ for pdf_fname in "$@"; do
|
||||||
process_pdf "$pdf_fname"
|
process_pdf "$pdf_fname"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Restarting xochitl"
|
if [[ reboot -eq 1 ]]; then
|
||||||
ssh "$user@$host" systemctl restart xochitl
|
echo "Rebooting device"
|
||||||
|
ssh "$user@$host" systemctl reboot
|
||||||
|
else
|
||||||
|
echo "Restarting xochitl"
|
||||||
|
ssh "$user@$host" systemctl restart xochitl
|
||||||
|
fi
|
||||||
echo "Done"
|
echo "Done"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue