mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-20 00:21:35 +00:00
Only grep first host from .ini file in rcfile when shutting down.
Submitted by: Damien Fleuriot <dam@c-mal.com> Approved by: Daniel Bretoi <daniel@netwalk.org> (maintainer) PR: ports/153357
This commit is contained in:
parent
fa3eef2740
commit
3a4b735d9a
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=269599
@ -7,6 +7,7 @@
|
||||
|
||||
PORTNAME= sabnzbdplus
|
||||
PORTVERSION= 0.5.6
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= news
|
||||
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/sabnzbd-${PORTVERSION}
|
||||
DISTNAME= SABnzbd-${PORTVERSION}-src
|
||||
|
@ -46,7 +46,7 @@ sabnzbd_stop() {
|
||||
echo "Stopping $name"
|
||||
if [ -f "${sabnzbd_conf_dir}/sabnzbd.ini" ]; then
|
||||
apikey=`grep ^api_key ${sabnzbd_conf_dir}/sabnzbd.ini | tr -d " _"`
|
||||
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].'`
|
||||
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].'`
|
||||
if [ ${host} = "0.0.0.0" ] ; then host="localhost" ; fi
|
||||
port=`grep -m1 ^port ${sabnzbd_conf_dir}/sabnzbd.ini | tr -dc '[0-9]'`
|
||||
fetch -o /dev/null "http://${host}:${port}/api?mode=shutdown&${apikey}" > /dev/null 2>&1
|
||||
|
Loading…
Reference in New Issue
Block a user