SABnzbd: create and add random apikey on first start

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2011-01-18 21:17:09 +01:00
parent 26e7016291
commit e9eedcd66c
2 changed files with 9 additions and 5 deletions

View File

@ -15,11 +15,11 @@ __version__ = 18
dirscan_speed = 5
enable_filejoin = 1
create_group_folders = 0
api_key = 2f6c67ec869e65df6962d830a5ad8eab
api_key = @API_KEY@
no_penalties = 0
bandwidth_limit = 0
dirscan_dir = /storage/downloads/watch/
disable_api_key = 1
disable_api_key = 0
email_to = ,
password = ""
permissions = ""
@ -202,14 +202,14 @@ __version__ = 18
newzbin = Emulation
dir = Emulation
[servers]
[[change_me_first:119]]
[[localhost:119]]
username = ""
enable = 1
name = change_me_first:119
name = localhost:119
fillserver = 0
connections = 8
ssl = 0
host = change_me_first
host = localhost
timeout = 120
password = ""
optional = 0

View File

@ -37,6 +37,10 @@
if [ ! -f $HOME/.sabnzbd/sabnzbd.conf ]; then
mkdir -p $HOME/.sabnzbd
cp /usr/lib/SABnzbd/sabnzbd.config $HOME/.sabnzbd/sabnzbd.conf
# create api key
API_KEY=`cat /dev/urandom |od -N16 -tx1 |cut -c8- |tr -d ' \n'`
sed -e "s,@API_KEY@,$API_KEY,g" -i $HOME/.sabnzbd/sabnzbd.conf
fi
python /usr/lib/SABnzbd/SABnzbd.py -d -f $HOME/.sabnzbd/sabnzbd.conf -l 0 > /dev/null 2>&1