From 1ddbd75d065470fd393265d921da97e74b7efa59 Mon Sep 17 00:00:00 2001 From: xerus2000 <27jf@pm.me> Date: Fri, 13 Nov 2020 13:34:30 +0100 Subject: [PATCH] config/yadm/bootstrap: improve service & sudoers --- .config/yadm/bootstrap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/yadm/bootstrap b/.config/yadm/bootstrap index e5298d8..ad80ab2 100755 --- a/.config/yadm/bootstrap +++ b/.config/yadm/bootstrap @@ -13,7 +13,7 @@ highlight "Default sudoers configuration" echo "Defaults editor=/usr/bin/nvim" | sudo tee /etc/sudoers.d/editor echo "Defaults timestamp_timeout=20" | sudo tee /etc/sudoers.d/timeout highlight "password-free reboot" -echo "$USER ALL = NOPASSWD: /sbin/halt, /sbin/reboot, /sbin/poweroff" | sudo tee /etc/sudoers.d/shutdown +echo "$USER ALL = NOPASSWD: /sbin/halt, /sbin/reboot, /usr/sbin/reboot, /sbin/poweroff, /usr/sbin/shutdown" | sudo tee /etc/sudoers.d/shutdown highlight "Reduce system startup & shutdown timeout" sudo mkdir -p /etc/systemd/system.conf.d /etc/systemd/user.conf.d @@ -66,8 +66,8 @@ echo " 0,20,40 * * * * janek pgrep workrave || XAUTHORITY='$XDG_CACHE_HOME/Xaut highlight "Cron logging" echo 'cron.* /var/log/cron.log' | sudo tee /etc/rsyslog.d/60-cron.conf -alias hasService="which service 2>/dev/null" -hasService && sudo service rsyslog restart || sudo systemctl restart rsyslog +hasService=$(which service 2>/dev/null) +test "$hasService" && sudo service rsyslog restart || sudo systemctl restart rsyslog highlight "Reload cron" -hasService && sudo service cron reload || sudo systemctl reload cronie +test "$hasService" && sudo service cron reload || sudo systemctl reload cronie