systemd: Bail properly on root auth failure

Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
Harsh Shandilya 2019-12-02 15:45:14 +05:30
parent c1d85b4eaa
commit 88f70da79b
No known key found for this signature in database
GPG key ID: C2E74282C2133D62

View file

@ -15,6 +15,8 @@ for service in "${services[@]}"; do
if [ "${1}" ] && [[ "${service}" != "${1}" && "${service}.service" != "${1}" ]]; then if [ "${1}" ] && [[ "${service}" != "${1}" && "${service}.service" != "${1}" ]]; then
continue continue
fi fi
prettyPrint "Checking root access"
sudo -v || return 1
prettyPrint "Installing ${service}" prettyPrint "Installing ${service}"
sudo cp -v "${service}.service" /etc/systemd/system/ sudo cp -v "${service}.service" /etc/systemd/system/
sudo systemctl daemon-reload sudo systemctl daemon-reload