Sonosweb: Ein einfaches Webfrontend für Sonos auf Gentoo

Sonosweb ist ein Perl Script welches einem einfachen Browser die Steuerung der Sonos Player erlaubt. Ich brauche das neben der echten Steuerung damit ich von meinen Linux Clients steuern kann.  Hier meine Aufzeichnungen und die Init Scripte für Gentoo.

201005-sonos-web-install.gif

Es fehlten auf meinem Server noch einige Bibliotheken. Bei mir waren es folgende drei und so habe ich sie auf meinem Gentoo Server nachinstalliert.

emerge -av dev-perl/SOAP-Lite dev-perl/XML-Simple dev-perl/HTML-Template
wget http://www.purple.org/sonos/sonosweb-0.72.tar.gz
tar xzvf sonosweb-0.72.tar.gz
rm sonosweb-0.72.tar.gz
cd sonos/
./sonos.pl -config
Configure the defaults for sonos.pl by creating a config.pl file.
Press return or enter key to keep current values.
Remove the config.pl to reset to the system defaults.

Port to listen on [8001]: 8002
Max log level 0=crit 4=debug [0]:
Max search results [500]:
Default web page, must exist in html directory [index.html]:

Location on local disk that Sonos indexes, a subdirectory SonosWeb will be created.
Use forward slashes only (ex c:/Music), enter single space to clear []: /video/music

Password for access to web site. (Notice, this isn't secure at all.)
Enter single space to clear []: 

Ignore traffic from these comma seperated ips
Enter single space to clear []: 

Please restart sonos.pl now

Manuel starten und schauen ob es klappt. Dann brauchen wir noch ein Script damit der Service automatisch bei einem Neustart gestartet wird. Ja ich weiss ist etwas brutal und nicht schön aber geht. Dann noch ausführbar machen und automatisch starten lassen.

vi /etc/init.d/sonos

#!/sbin/runscript
depend() {
        need net
        #sonos
}
start() {
        ebegin "Starting sonos"
        sonos_home=/opt/caserio/tools/sonos/
        cd ${sonos_home}
        ./sonos.pl >/dev/null 2>&1 &
        eend $?
}
stop() {
        ebegin "Stopping sonos"
        pkill sonos.pl
        eend $?
}

chmod +x /etc/init.d/sonos
rc-update add sonos default
 * sonos added to runlevel default