diff --git a/bin/sat b/bin/sat index a3a9a334..6ccea7b4 100755 --- a/bin/sat +++ b/bin/sat @@ -3,7 +3,16 @@ DEBUG="" DAEMON="" PYTHON="python3" -TWISTD="$(which twistd)" + +# for Python 3, "twistd" is named "twistd3" on some distros, so we check for it first +TWISTD="$(which twistd3 2>/dev/null)" +if [ $? -ne 0 ]; then + TWISTD="$(which twistd 2>/dev/null)" +fi +if [ $? -ne 0 ]; then + printf "Can't find \"twistd\" script, are you sure that Twisted is installed?\n" + exit 1 +fi kill_process() { # $1 is the file containing the PID to kill, $2 is the process name