X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=sh-lib;h=be6f60ea342ec263861bfc0f2dfdb1fc3bb03acd;hb=a69ffc4d328e3a10a42bb7ba5127ce7e9d139dff;hp=9896f71c44b1c4046ccc4b808c89a8e7d61eaa65;hpb=174f38e91192fb8a1f39298ec484a6e0f3ed9f84;p=grml-shlib.git diff --git a/sh-lib b/sh-lib index 9896f71..be6f60e 100644 --- a/sh-lib +++ b/sh-lib @@ -177,6 +177,10 @@ function warnLog # ### +## +# ATTENTION... THIS FUNCTINOS IS A BIG SECURITY HOLE +# this function will be changed in future release +## # i don't want to write exit status controle stuff every time function execute { @@ -186,6 +190,7 @@ function execute local ret_='' + # NOT A GOOD IDEA eval "$to_exec_" ret_=$? @@ -306,6 +311,16 @@ function checkRoot checkId 0 "$1" "$2" } +function isGrml +{ + if [ -f /etc/grml_version ] ; then + dprint "isGrml(): this seems to be a grml system" + return 0 + else + dprint "isGrml(): this is not a grml system" + return 1 + fi +} function runsFromHd { @@ -608,9 +623,10 @@ function _touchService function _createServiceFunctions { - for i in "start" "stop" "restart" "reload" "force-reload"; do + for i in "start" "stop" "restart" "reload"; do eval "function ${i}Service { _touchService ${i} \"\$1\" \"\$2\" \"\$3\"; }" done + eval "function forceReloadService { _touchService force-reload \"\$1\" \"\$2\" \"\$3\"; }" } _createServiceFunctions # }}}