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 <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
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
}
stop_service() {
- if [ -e "/etc/init.d/${1}" ]; then
+ if [ -f "/etc/init.d/${1}" ]; then
/etc/init.d/${1} stop
fi
}