Skip to content

Instantly share code, notes, and snippets.

@gioxx
Last active June 10, 2017 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gioxx/0c928f2a24d7bfba18f3cd0eb730c228 to your computer and use it in GitHub Desktop.
Save gioxx/0c928f2a24d7bfba18f3cd0eb730c228 to your computer and use it in GitHub Desktop.
Un banale script sh per pilotare l'esecuzione (così come lo spegnimento / riavvio) di aMule AdunanzA installato su Synology.
#! /bin/sh
case "$1" in
start)
echo –n "Starting aMule ..."
/opt/bin/amuled -f
/opt/bin/amuleweb --admin-pass='PASSWORDCHEHAISCELTO' -q &
echo "Done."
;;
restartweb)
echo "Stopping aMule Web Interface ..."
PIDS=$(ps -eaf)
PID=$(echo "$PIDS" | grep "amuleweb" | awk '{print $2}')
kill -9 $PID
echo "aMule Web Interface Killed."
/opt/bin/amuleweb --admin-pass='PASSWORDCHEHAISCELTO' -q &
echo "aMule Web Interface Started."
;;
stop)
echo "Stopping aMule ..."
PIDS=$(ps -eaf)
PID=$(echo "$PIDS" | grep "amuled -f" | awk '{print $2}')
kill -9 $PID
echo "aMule Daemon Killed."
PID=$(echo "$PIDS" | grep "amuleweb" | awk '{print $2}')
kill -9 $PID
echo "aMule Web Interface Killed."
;;
restart)
echo –n "Stopping aMule ..."
PIDS=$(ps -eaf)
PID=$(echo "$PIDS" | grep "amuled -f" | awk '{print $2}')
kill -9 $PID
echo "aMule Daemon Killed."
PID=$(echo "$PIDS" | grep "amuleweb" | awk '{print $2}')
kill -9 $PID
echo "aMule Web Interface Killed."
echo "Starting aMule ..."
/opt/bin/amuled -f
/opt/bin/amuleweb --admin-pass='PASSWORDCHEHAISCELTO' -q &
echo "Done."
;;
*)
echo "Usage: aMuleStart start|stop|restart|restartweb"
exit 1
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment