Browse Source

Fixed the FreeBSD init-script.

pull/381/head
Joachim Tingvold 13 years ago
parent
commit
4859f1b9f2
  1. 6
      init/freebsd

6
init/freebsd

@ -42,7 +42,7 @@ status_cmd="${name}_status"
stop_cmd="${name}_stop" stop_cmd="${name}_stop"
command="/usr/sbin/daemon" command="/usr/sbin/daemon"
command_args="-f -p ${couchpotato_pid} python ${couchpotato_dir}/couchpotato.py ${couchpotato_flags}" command_args="-f -p ${couchpotato_pid} python ${couchpotato_dir}/CouchPotato.py ${couchpotato_flags}"
# Check for wget and refuse to start without it. # Check for wget and refuse to start without it.
if [ ! -x "${WGET}" ]; then if [ ! -x "${WGET}" ]; then
@ -59,7 +59,7 @@ fi
verify_couchpotato_pid() { verify_couchpotato_pid() {
# Make sure the pid corresponds to the CouchPotato process. # Make sure the pid corresponds to the CouchPotato process.
pid=`cat ${couchpotato_pid} 2>/dev/null` pid=`cat ${couchpotato_pid} 2>/dev/null`
ps -p ${pid} | grep -q "python ${couchpotato_dir}/couchpotato.py" ps -p ${pid} | grep -q "python ${couchpotato_dir}/CouchPotato.py"
return $? return $?
} }
@ -67,7 +67,7 @@ verify_couchpotato_pid() {
couchpotato_stop() { couchpotato_stop() {
echo "Stopping $name" echo "Stopping $name"
verify_couchpotato_pid verify_couchpotato_pid
${WGET} -O - -q "http://${HOST}:${PORT}/${CPAPI}/app.shutdown/" >/dev/null ${WGET} -O - -q "http://${HOST}:${PORT}/api/${CPAPI}/app.shutdown/" >/dev/null
if [ -n "${pid}" ]; then if [ -n "${pid}" ]; then
wait_for_pids ${pid} wait_for_pids ${pid}
echo "Stopped" echo "Stopped"

Loading…
Cancel
Save