View | Details | Raw Unified | Return to bug 153357
Collapse All | Expand All

(-)sabnzbd 2011-02-24 11:34:37.000000000 +0100 (-1 / +1 lines)
Lines 46-52 Link Here
46
    echo "Stopping $name"
46
    echo "Stopping $name"
47
    if [ -f "${sabnzbd_conf_dir}/sabnzbd.ini" ]; then
47
    if [ -f "${sabnzbd_conf_dir}/sabnzbd.ini" ]; then
48
        apikey=`grep ^api_key ${sabnzbd_conf_dir}/sabnzbd.ini | tr -d " _"`
48
        apikey=`grep ^api_key ${sabnzbd_conf_dir}/sabnzbd.ini | tr -d " _"`
49
        host=`grep -E '^host\ =\ [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' ${sabnzbd_conf_dir}/sabnzbd.ini | tr -dc '[0-9].'`
49
        host=`grep -m1 -E '^host\ =\ [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' ${sabnzbd_conf_dir}/sabnzbd.ini | tr -dc '[0-9].'`
50
        if [ ${host} = "0.0.0.0" ] ; then host="localhost" ; fi
50
        if [ ${host} = "0.0.0.0" ] ; then host="localhost" ; fi
51
        port=`grep -m1 ^port ${sabnzbd_conf_dir}/sabnzbd.ini | tr -dc '[0-9]'`
51
        port=`grep -m1 ^port ${sabnzbd_conf_dir}/sabnzbd.ini | tr -dc '[0-9]'`
52
        fetch -o /dev/null "http://${host}:${port}/api?mode=shutdown&${apikey}" > /dev/null 2>&1
52
        fetch -o /dev/null "http://${host}:${port}/api?mode=shutdown&${apikey}" > /dev/null 2>&1

Return to bug 153357