diff --git a/bin/mcserv b/bin/mcserv index 2871fe3..e64fb8c 100755 --- a/bin/mcserv +++ b/bin/mcserv @@ -25,21 +25,33 @@ error_usage() { } public_start() { - mcscreen -d -m -S "$1" \ - "/srv/minecraft/bin/${1}" + if [ -n "$1" ]; then + mcscreen -d -m -S "$1" \ + "/srv/minecraft/bin/${1}" + else + error_usage + fi } public_status() { - printf '\033[1m%s\033[0m : ' "$1" - if mcscreen -ls "$1" > /dev/null 2>&1; then - echo "en cours d'exécution" + if [ -n "$1" ]; then + printf '\033[1m%s\033[0m : ' "$1" + if mcscreen -ls "$1" > /dev/null 2>&1; then + echo "en cours d'exécution" + else + echo "non en cours d'exécution" + fi else - echo "non en cours d'exécution" + error_usage fi } public_stop() { - mcscreen -S "$1" -X stuff '^E^Ustop^M' + if [ -n "$1" ]; then + mcscreen -S "$1" -X stuff '^E^Ustop^M' + else + error_usage + fi } public_watch() {