From 88f70da79b8f680bd46e2ec8decf3dea1ead17d3 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Mon, 2 Dec 2019 15:45:14 +0530 Subject: [PATCH] systemd: Bail properly on root auth failure Signed-off-by: Harsh Shandilya --- systemd_units/update.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/systemd_units/update.sh b/systemd_units/update.sh index 6a9e880..6c44d0a 100755 --- a/systemd_units/update.sh +++ b/systemd_units/update.sh @@ -15,6 +15,8 @@ for service in "${services[@]}"; do if [ "${1}" ] && [[ "${service}" != "${1}" && "${service}.service" != "${1}" ]]; then continue fi + prettyPrint "Checking root access" + sudo -v || return 1 prettyPrint "Installing ${service}" sudo cp -v "${service}.service" /etc/systemd/system/ sudo systemctl daemon-reload