From: Jonatan Schlag Date: Fri, 10 Jun 2016 08:13:41 +0000 (+0200) Subject: Fix in pakfire functions.sh X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e6fd1f2d3876aae2c37051fce718f68712fdee4a;p=people%2Fms%2Fipfire-2.x.git Fix in pakfire functions.sh The if statement in line 89 and 99 are useless with the -e conditional expression because it returns true if the path ist a regular file or a directory. So "/etc/init.d/ " returns true and "/etc/init.d/avahi" return also true, but the statement should return only true if we have a regular file. So -f if the right conditional expression, and we only try to execute the init script if the path "/etc/init.d/${1}" points to a regular file. Signed-off-by: Jonatan Schlag Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/lib/functions.sh b/src/pakfire/lib/functions.sh index 3f7dbff55f..375169760e 100644 --- a/src/pakfire/lib/functions.sh +++ b/src/pakfire/lib/functions.sh @@ -86,7 +86,7 @@ start_service() { esac done - if [ -e "/etc/init.d/${1}" ]; then + if [ -f "/etc/init.d/${1}" ]; then if [ -n "${BACKGROUND}" ]; then (sleep ${DELAY} && /etc/init.d/${1} start) & else @@ -96,7 +96,7 @@ start_service() { } stop_service() { - if [ -e "/etc/init.d/${1}" ]; then + if [ -f "/etc/init.d/${1}" ]; then /etc/init.d/${1} stop fi }