mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
pianod: Add Pandora Radio player daemon
* Integrate as OpenWrt daemon * Build with PolarSSL (replaces GNUTLS) * Add optional client WebUI * Fix some socket failure handling and segfaults Signed-off-by: Ted Hess <thess@kitschensync.net>
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2015 OpenWrt.org
|
||||
|
||||
NAME=pianod
|
||||
START=95
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
PD_USER=$NAME
|
||||
PD_STARTSCRIPT=/etc/$NAME/startscript
|
||||
PD_PASSWDFILE=/etc/$NAME/users
|
||||
PD_WEBUI=/www/$NAME
|
||||
|
||||
start_service() {
|
||||
# Take group ownership of audio devices
|
||||
chown root:$NAME /dev/snd/* /dev/mixer /dev/dsp
|
||||
chmod 664 /dev/snd/* /dev/mixer /dev/dsp
|
||||
|
||||
procd_open_instance
|
||||
|
||||
procd_set_param command "/usr/bin/$NAME"
|
||||
|
||||
procd_append_param command -n $PD_USER
|
||||
procd_append_param command -i "$PD_STARTSCRIPT"
|
||||
procd_append_param command -u "$PD_PASSWDFILE"
|
||||
[ -d "$PD_WEBUI" ] && procd_append_param command -c "$PD_WEBUI"
|
||||
# No HTTPS support without certificates
|
||||
procd_append_param command -s 0
|
||||
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
# Wait for service to exit and release sockets
|
||||
reload_service() {
|
||||
stop
|
||||
sleep 2
|
||||
start
|
||||
}
|
||||
|
||||
restart() {
|
||||
reload_service
|
||||
}
|
||||
Reference in New Issue
Block a user