diff --git a/samba.sh b/samba.sh index b105d3e..dbce434 100755 --- a/samba.sh +++ b/samba.sh @@ -104,13 +104,13 @@ shift $(( OPTIND - 1 )) [[ "${TIMEZONE:-""}" ]] && timezone "$TIMEZONE" -if ps -ef | egrep -v grep | grep -q smbd; then - echo "Service already running, please restart container to apply changes" -elif [[ $# -ge 1 && -x $(which $1 2>&-) ]]; then +if [[ $# -ge 1 && -x $(which $1 2>&-) ]]; then exec "$@" elif [[ $# -ge 1 ]]; then echo "ERROR: command not found: $1" exit 13 +elif ps -ef | egrep -v grep | grep -q smbd; then + echo "Service already running, please restart container to apply changes" else exec ionice -c 3 smbd -FS fi