# HG changeset patch # User Dirk Olmes # Date 1537168743 -7200 # Node ID 383ea800bf98b55cd51e19448e2793240e329655 # Parent 870bb3be824fb5b18e7293f0550515bcd196bbf9 include sudo diff -r 870bb3be824f -r 383ea800bf98 zshrc-systemd --- a/zshrc-systemd Mon Sep 03 13:11:19 2018 +0200 +++ b/zshrc-systemd Mon Sep 17 09:19:03 2018 +0200 @@ -1,3 +1,8 @@ function sc() { - systemctl $2 $1 + local SUDO="" + + if [[ $USER != "root" ]]; then + SUDO="sudo" + fi + $SUDO systemctl $2 $1 }