diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2009-03-04 18:41:39 +0100 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2009-03-04 18:41:39 +0100 |
commit | 10d3bfa1a32611c382d0bc7044ebd219f20e26c4 (patch) | |
tree | f5b7a0059207a20b1b138f520df61b75f40124a6 | |
parent | c26adbeded422f542c5541cf8a8174bd69c1fe65 (diff) |
Start/Stop/...: Don't call sudo unneccessarily
-rw-r--r-- | etc/function | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/etc/function b/etc/function index 3b6e122..783d79b 100644 --- a/etc/function +++ b/etc/function @@ -12,7 +12,14 @@ unset funcfile function Start Stop Restart Reload { typeset script + function __sudo { + if ((EUID)) { + sudo $* + } else { + $* + } + } for script in $*; { - sudo /etc/init.d/$script ${0:l} + __sudo /etc/init.d/$script ${0:l} } } |