Add tabbed settings and system shell
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
set -Eeuo pipefail
|
||||
|
||||
if [[ ${EUID} -ne 0 ]]; then
|
||||
echo "The power helper must run as root." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "${1:-}" in
|
||||
reboot|poweroff)
|
||||
action="$1"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: pi-car-companion-power reboot|poweroff" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
/usr/bin/systemd-run \
|
||||
--quiet \
|
||||
--collect \
|
||||
--on-active=3s \
|
||||
--unit="pi-car-companion-${action}" \
|
||||
/usr/bin/systemctl "${action}"
|
||||
Reference in New Issue
Block a user