搭建完美的媒体服务器:Ubuntu 11.10(1)(7)
打开终端窗口,执行下列几个命令。
wget https://github.com/rembo10/headphones/tarball/master -O headphones.tar.gz
tar xvf headphones.tar.gz
ls
ls命令执行完毕后,你会看到这样的信息:
user@media-server:~$ ls
Desktop examples.desktop Pictures Templates
Documents headphones.tar.gz Public Videos
Downloads Music rembo10-headphones-514844e
user@media-server:~$
我们想把rembo10-headphones-xxxxxxx移到.headphones,为此可以使用下列命令来实现你需要改动命令,适合文件夹名称):
mv rembo10-headphones-514844e .headphones
sudo mv .headphones/init.ubuntu /etc/init.d/headphones
sudo chmod +x /etc/init.d/headphones
sudo gedit /etc/init.d/headphones
把APP_PATH改成/home/user/.headphones,其中user是你的用户名,将RUN_AS更改成你的用户名,之后你的文件应该看起来这样:
#! /bin/sh
### 开始初始化信息
# Provides: Headphones application instance
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# 简短描述:启动Headphones的实例
# 描述:使用start-stop-daemon,启用Headphones的实例
### 结束初始化信息
############### EDIT ME ##################
# 应用程序路径
APP_PATH=/home/user/.headphones
# python bin路径
DAEMON=/usr/bin/python
# 启动参数
DAEMON_OPTS="Headphones.py -q"
# 脚本名称
NAME=headphones
# 应用程序名称
DESC=headphones
# 用户
RUN_AS=user
PID_FILE=/var/run/headphones.pid
############### 结束EDIT ME ##################
test -x $DAEMON || exit 0
set -e
case "$1" in
start)
echo "Starting $DESC"
start-stop-daemon -d $APP_PATH -c $RUN_AS --start --background --pidfile $PID_FILE --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
;;
stop)
echo "Stopping $DESC"
start-stop-daemon --stop --pidfile $PID_FILE
;;
restart|force-reload)
echo "Restarting $DESC"
start-stop-daemon --stop --pidfile $PID_FILE
sleep 15
start-stop-daemon -d $APP_PATH -c $RUN_AS --start --background --pidfile $PID_FILE --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
现在,我们可以将headphones设成启动时运行,开始让它运行。
sudo update-rc.d headphones defaults
sudo service headphones start
你会看到告知服务已启动的消息,这时可以回到Firefox,打开Headphones界面,默认端口是8181,于是浏览到http://localhost:8181,你应该会看到headphones界面。如果你看到You're running an unknown version of Headphones. Click here to update你在运行Headphones的未知版本。点击此处,即可更新)链接,点击该链接即可更新。稍后,Headphones应该会更新并重启,你可能需要点击刷新。
如果headphones没有重新启动,请回到终端,重启它。
sudo service headphones start
点击设置,进入到设置页面;与SABnzbd+/SickBeard和Couchpotato不一样,Headphones的所有设置都在一个页面上。
为Web界面设置用户名和密码。
输入SABnzbd的详细资料:
SABnzbd Host name http://localhost:8080, SABnzbd username, SABnzbd password and SABnzbd API key.
至于SABnzbd Category,输入music。
至于Music download Directory,输入/home/user/Downloads/complete/music,将user换成你的用户名。
启用你想要使用的搜索提供商,输入相应信息,向下移到Quality质量)和Post Processing后期处理)部分。
质量设置不用管,但是要勾选后期处理的所有选项。
将你的目的地文件夹路径成/Media/Music,保存变更。现在大功告成,设置好了自动下载电视节目、电影和音乐,现在最后一步是如何从你的PlayStation 3观看这一切内容。
评论暂时关闭