Browse Source

n/sabnzbd: Fixed various admin problems.

slackware-14.2
Damien Goutte-Gattat 12 years ago
parent
commit
7f14edd528
  1. 6
      n/sabnzbd/doinst.sh
  2. 4
      n/sabnzbd/rc.sabnzbd
  3. 6
      n/sabnzbd/sabnzbd.SlackBuild
  4. 4
      n/sabnzbd/sabnzbd.ini

6
n/sabnzbd/doinst.sh

@ -10,7 +10,7 @@ config()
fi
}
config etc/sabznbd.ini.new
config etc/sabnzbd.ini.new
# Create group and user accounts
if ! grep ^sabnzbd /etc/group > /dev/null ; then
@ -21,5 +21,9 @@ if ! grep ^sabnzbd /etc/passwd > /dev/null ; then
/usr/sbin/useradd -u 279 -c SABnzbd -d /var/lib/sabnzbd -g sabnzbd sabnzbd
fi
# Give the config file to the newly created user
chown sabnzbd:sabnzbd etc/sabnzbd.ini*
chmod 640 etc/sabnzbd.ini*
# Generate byte-compiled code
python -OO /usr/libexec/sabnzbd/SABnzbd.py --help > /dev/null

4
n/sabnzbd/rc.sabnzbd

@ -9,13 +9,13 @@ case "$1" in
start)
echo "Starting SABnzbd."
for d in download complete dirscan log admin cache ; do
dir=`sed -n -r 's/^'$d' = (.*)/\1/p' $CONFIG_FILE`
dir=`sed -n -r 's/^'$d'_dir = (.*)/\1/p' $CONFIG_FILE`
if [ ! -d "$dir" ]; then
mkdir -p "$dir"
chown sabnzbd:sabnzbd "$dir"
fi
done
/usr/bin/sudo -u sabnzbd -H /usr/sbin/sabnzbd -d -f $CONFIG_FILE
/usr/bin/sudo -u sabnzbd -H /usr/libexec/sabnzbd/SABnzbd.py -d -f $CONFIG_FILE
;;
stop)

6
n/sabnzbd/sabnzbd.SlackBuild

@ -25,7 +25,7 @@
# Latest sabnzbd sourcecode is available at: <http://www.sabnzbd.org/>.
#
# Depends: l/cheetah, l/python-enc, ap/par2
# Recommends: ap/unrar, pyopenssl
# Recommends: ap/unrar, l,pyopenssl
# Source package infos
NAMESRC=${NAMESRC:-SABnzbd}
@ -35,7 +35,7 @@ WGET=${WGET:-http://downloads.sourceforge.net/sabnzbdplus/$ARCHIVE}
# Build infos
NAMEPKG=${NAMEPKG:-sabnzbd}
BUILD=${BUILD:-1GGD}
BUILD=${BUILD:-2GGD}
ARCH=${ARCH:-$(uname -m | sed 's/^i.86$/i486/;s/^arm.*/arm/')}
EXT=${EXT:-txz}
@ -84,7 +84,7 @@ install -m 644 CHANGELOG.txt COPYRIGHT.txt GPL?.txt ISSUES.txt LICENSE.txt \
# Install template configuration file and control script
mkdir -p $PKG/etc/rc.d
install -m 644 $CWD/sabnzbd.ini $PKG/etc/sabnzbd.ini.new
install -m 644 $CWD/rc.sabnzbd $PKG/etc/rc.d/sabnzbd
install -m 644 $CWD/rc.sabnzbd $PKG/etc/rc.d/rc.sabnzbd
# Copy slack-desc and doinst.sh files
install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc

4
n/sabnzbd/sabnzbd.ini

@ -1,5 +1,3 @@
; Configuration file for SABnzbd
[misc]
host = localhost
port = 8080
@ -7,7 +5,7 @@ download_dir = /var/lib/sabnzbd/downloads/incomplete
complete_dir = /var/lib/sabnzbd/downloads/complete
dirscan_dir = /var/lib/sabnzbd/downloads/input
log_dir = /var/log/sabnzbd
admin_dir = /var/lib/sabnzbd/admin
admin_dir = /var/lib/sabnzbd
cache_dir = /var/cache/sabnzbd
permissions = "750"
language = us-en

Loading…
Cancel
Save