From 79ef3fb789375dfe4f191fd42d8cf7ff2dbb8cc5 Mon Sep 17 00:00:00 2001 From: Sebastian Wicki Date: Sun, 2 Feb 2014 18:32:14 +0100 Subject: Prohibit user invocation of netctl-auto [start|stop] Instead of using systemctl to manage the netctl-auto service, some users try to invoke the start/stop commands of netctl-auto directly. Although this behaviour is explicitly discouraged in the man page, this seems to be a source of confusion. The changes introduced in de8c80f will cause other netctl-auto commands to fail if the netctl-auto service was not spawned by systemd. Therefore, this change emits an error message if netctl-auto [start|stop] is invoked from an interactive terminal. --- src/netctl-auto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/netctl-auto b/src/netctl-auto index 4f53f75..507b1fc 100755 --- a/src/netctl-auto +++ b/src/netctl-auto @@ -253,6 +253,9 @@ case $# in switch-to) switch_to "$2";; start|stop) + if [[ -t 0 ]]; then + exit_error "Use 'systemctl $1 netctl-auto@$2' to $1 netctl-auto." + fi ensure_root "$(basename "$0")" "$1" "$2";; *) -- cgit v1.2.3-24-g4f1b