Coder Social home page Coder Social logo

Comments (4)

gabrielpc1190 avatar gabrielpc1190 commented on May 18, 2024

This may be a good example for the init script. Just need to figure out how to get the API from the config file. Got it from here

#! /bin/sh
### BEGIN INIT INFO
# Provides:          sabnzbd
# Short-Description: start/stop sabnzbd web interface
### END INIT INFO


USER="username"
HOME="/home/username"
SAB_IP="192.168.2.105:8080"
SAB_USER="login"
SAB_PASS="password"
SAB_APIKEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

case "$1" in
start)
  echo "Starting SABnzbd."
  /usr/bin/sudo -u $USER -H /usr/bin/sabnzbdplus -d -f $HOME/.sabnzbd/sabnzbd.ini
;;
stop)
  echo "Shutting down SABnzbd."
  /usr/bin/wget -q --delete-after "http://$SAB_IP/sabnzbd/api?mode=shutdown&ma_username=$SAB_USER&ma_password=$SAB_PASS&apikey=$SAB_APIKEY"
;;
*)
  echo "Usage: $0 {start|stop}"
  exit 1
esac

exit 0

from atomic-toolkit.

gabrielpc1190 avatar gabrielpc1190 commented on May 18, 2024

I did an script for myself and its working. I took parts from everywhere on internet. Please be free to use it as an example or for the Atomic toolkit. I am not an expert but tried so many times until I made it work. Please correct any part of it that it's wrong.

`#! /bin/sh

BEGIN INIT INFO

Provides: sabnzbdplus

Required-Start:

Required-Stop:

Should-Start: dbus avahi network-manager wicd

Should-Stop: dbus avahi network-manager wicd

Default-Start: 2 3 4 5

Default-Stop: 0 1 6

Short-Description: SABnzbd+ binary newsgrabber

Description: SABnzbd+ is a web-based binary newsgrabber with nzb

support, designed to download files from Usenet.

This script provides that functionality as a system

service, starting the program on boot.

END INIT INFO

USER="changetoyouruser"
HOME="/home/$USER"
SAB_IP="127.0.0.1:8080"
SAB_APIKEY="insertyourapikey"
DAEMON="/usr/bin/sabnzbdplus"
SETTINGS="$HOME/.sabnzbd/sabnzbd.ini"

##------------------------------------------------------------------------##
case "$1" in
start)
echo "Starting SABnzbd."
/usr/bin/sudo -u $USER -H $DAEMON -d -f $SETTINGS
;;
stop)
echo "Shutting down SABnzbd."
/usr/bin/wget -q --delete-after "http://$SAB_IP/sabnzbd/api?mode=shutdown&apikey=$SAB_APIKEY"
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac

exit 0`

from atomic-toolkit.

TommyE123 avatar TommyE123 commented on May 18, 2024

I've updated SABnzbd+ to use systemd as default however it does still fallback to init.d if your distro doesnt support it. Can anyone confirm the init.d script is working for them in the new Toolkit version?

from atomic-toolkit.

TommyE123 avatar TommyE123 commented on May 18, 2024

I've not heard any bad feeback on this so will assume its ok. Please log an issue if anyone finds a problem.

Thanks

from atomic-toolkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.