Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (27 sloc) 1.04 KB
cd ~/bin
API_KEY=`cat SABnzbd/sabnzbd.ini | grep ^api_key | awk '{print $3}'`
PORT=` cat SABnzbd/sabnzbd.ini | grep ^https_port | awk '{print $3}'`
VERSION=`curl -s | head -n1`
DATE=`date +'%Y%m%d-%H%M'`
echo "Downloading SABnzbd ${VERSION} (${GZ})"
curl -s -C - -O "${VERSION}/${GZ}"
# Alternative source: SWITCH (ch)
# curl -s -C - -O ""
echo "Unpacking ${GZ}"
tar -xzf ${GZ}
rm ${GZ}
echo "Shutting down SABnzbd+"
curl -s "http://localhost:${PORT}/sabnzbd/api?mode=shutdown&apikey=${API_KEY}" >> /dev/null
echo "Installing new SABnzbd+"
cp SABnzbd/sabnzbd.ini ${DIR}/sabnzbd.ini
mkdir -p ~/archives/
mv SABnzbd ~/archives/SABnzbd_${DATE}
mv ${DIR} SABnzbd
echo "Restarting SABnzdb+"
python SABnzbd/ -d
# Go back to the previous directory
echo "Upgrade complete !"
cd -