Add tabbed settings and system shell
This commit is contained in:
@@ -18,6 +18,14 @@ RELEASE_TMP=""
|
||||
FROM_REVISION=""
|
||||
TO_REVISION=""
|
||||
PHASE="checking for updates"
|
||||
CHECK_ONLY=false
|
||||
|
||||
if [[ "${1:-}" == "--check-only" ]]; then
|
||||
CHECK_ONLY=true
|
||||
elif [[ $# -gt 0 ]]; then
|
||||
echo "Usage: pi-car-companion-update [--check-only]" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [[ ${EUID} -ne 0 ]]; then
|
||||
echo "The update helper must run as root." >&2
|
||||
@@ -57,8 +65,10 @@ install_integration_files() {
|
||||
local source_release="$1"
|
||||
install -m 0755 "${source_release}/scripts/pi-car-companion-update" /usr/local/sbin/pi-car-companion-update
|
||||
install -m 0755 "${source_release}/scripts/pi-car-companion-network-setup" /usr/local/sbin/pi-car-companion-network-setup
|
||||
install -m 0755 "${source_release}/scripts/pi-car-companion-power" /usr/local/sbin/pi-car-companion-power
|
||||
install -m 0644 "${source_release}/systemd/pi-car-companion.service" /etc/systemd/system/pi-car-companion.service
|
||||
install -m 0644 "${source_release}/systemd/pi-car-companion-update.service" /etc/systemd/system/pi-car-companion-update.service
|
||||
install -m 0644 "${source_release}/systemd/pi-car-companion-update-check.service" /etc/systemd/system/pi-car-companion-update-check.service
|
||||
install -m 0644 "${source_release}/systemd/pi-car-companion-network.service" /etc/systemd/system/pi-car-companion-network.service
|
||||
install -m 0644 "${source_release}/systemd/pi-car-companion-network-configure.service" /etc/systemd/system/pi-car-companion-network-configure.service
|
||||
install -m 0644 "${source_release}/systemd/pi-car-companion-network-observer.service" /etc/systemd/system/pi-car-companion-network-observer.service
|
||||
@@ -115,9 +125,11 @@ fi
|
||||
TO_REVISION="$(git -C "${REPOSITORY}" rev-parse "origin/${branch}")"
|
||||
|
||||
if [[ -n "${FROM_REVISION}" && "${FROM_REVISION}" == "${TO_REVISION}" ]]; then
|
||||
install_integration_files "${CURRENT}"
|
||||
visudo -cf /etc/sudoers.d/pi-car-companion >/dev/null
|
||||
systemctl daemon-reload
|
||||
if [[ "${CHECK_ONLY}" != "true" ]]; then
|
||||
install_integration_files "${CURRENT}"
|
||||
visudo -cf /etc/sudoers.d/pi-car-companion >/dev/null
|
||||
systemctl daemon-reload
|
||||
fi
|
||||
write_status "current" "Pi Car Companion is already up to date."
|
||||
exit 0
|
||||
fi
|
||||
@@ -127,6 +139,11 @@ if [[ -n "${FROM_REVISION}" ]] && ! git -C "${REPOSITORY}" merge-base --is-ances
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "${CHECK_ONLY}" == "true" ]]; then
|
||||
write_status "available" "A newer Pi Car Companion release is available to install."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
PHASE="building the new release"
|
||||
write_status "building" "Downloading dependencies and verifying the new release."
|
||||
install -d -m 0755 "${STAGING_ROOT}" "${RELEASES}"
|
||||
|
||||
Reference in New Issue
Block a user