summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-03-04 18:41:39 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2009-03-04 18:41:39 +0100
commit10d3bfa1a32611c382d0bc7044ebd219f20e26c4 (patch)
treef5b7a0059207a20b1b138f520df61b75f40124a6
parentc26adbeded422f542c5541cf8a8174bd69c1fe65 (diff)
Start/Stop/...: Don't call sudo unneccessarily
-rw-r--r--etc/function9
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}
}
}