WIFIHELL - 科技改变生活

 找回密码
 注册WIFIHELL

QQ登录

只需一步,快速开始

开启左侧

[通用] 【自动安装】autoinstall ipkg+lighttpd+rtorrent+xmlrpc-c+rutorrent

[复制链接]
222ba 发表于 2015-4-27 12:25:08 | 显示全部楼层 |阅读模式

注册WIFIHELL,浏览更多技术贴!

您需要 登录 才可以下载或查看,没有账号?注册WIFIHELL

x
原帖:http://forum.synology.com/enu/viewtopic.php?f=38&t=21990

这个脚本是ARM NAS通用的,细节代码可能需要修改。

  1. #!/bin/sh

  2. LIGHTTPDCONF=/opt/etc/lighttpd/lighttpd.conf
  3. RTORRENTCONF=/opt/etc/rtorrent.conf

  4. mkdir -p /volume1/@tmp
  5. cd /volume1/@tmp/

  6. #  IPKG
  7. echo -e "\033[1mInstalling IPKG\033[0m"
  8. wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/syno-mvkw-bootstrap_1.2-7_arm.xsh
  9. sh syno-mvkw-bootstrap_1.2-7_arm.xsh &
  10. sleep 20
  11. ipkg update

  12. #  Lighttpd
  13. echo -e "\033[1mInstalling Lighttpd\033[0m"
  14. ipkg install lighttpd php-fcgi
  15. echo 'server.event-handler = "poll"' >> ${LIGHTTPDCONF}
  16. echo 'server.modules += ("mod_auth","mod_cgi","mod_scgi")' >> ${LIGHTTPDCONF}
  17. echo '
  18. scgi.server = ("/RPC2" =>
  19.   ("127.0.0.1" =>
  20.     ("host" => "127.0.0.1",
  21.      "port" => 5050,
  22.      "check-local" => "disable")
  23.     )
  24. )
  25. ' >> ${LIGHTTPDCONF}

  26. #  rtorrent
  27. echo -e "\033[1mInstalling RTorrent\033[0m"
  28. ipkg install rtorrent screen
  29. ipkg remove xmlrpc-c
  30. mkdir -p /opt/share/torrent/session/
  31. echo 'scgi_port = 127.0.0.1:5050' >> ${RTORRENTCONF}
  32. echo '#!/bin/sh

  33. NAME=rtorrent
  34. CONFIG=/opt/etc/rtorrent.conf
  35. LOGFILE=/opt/var/log/rtorrentInit.log
  36. TORRENTFILE=/opt/bin/rtorrent
  37. OPTIONS="-n -o import=$CONFIG"

  38. getsession() {
  39.     session=`sed -n "/session\s*=/s/^\s*session\s*=\s*//p" $CONFIG`
  40.     echo $session
  41. }

  42. case "$1" in
  43.   start)
  44.     screen -list|grep -sq $NAME && exit 0
  45.     session=`getsession`
  46.     [ -e $session/rtorrent.lock ] && rm -rf $session/rtorrent.lock
  47.     /opt/bin/screen -dmS $NAME $TORRENTFILE $OPTIONS 2>$LOGFILE
  48. ;;
  49.   stop)
  50.     session=`getsession`
  51.     ! [ -e $session/rtorrent.lock ] && exit 0
  52.     pid=`sed "s/[^0-9]//g" $session/rtorrent.lock`
  53.     ps|grep -v grep|grep -sq $pid.*rtorrent && kill $pid
  54. ;;
  55.   restart)
  56.     $0 stop
  57.     sleep 2
  58.     $0 start
  59. ;;
  60.   status)
  61.     screen -list|grep -s $NAME
  62. ;;
  63.   *)
  64.     echo $"Usage: \$0 {start|stop|status|restart}"
  65.     exit 1
  66. esac
  67. exit 0
  68. ' > /opt/etc/init.d/S99rtorrent

  69. #  xmlrpc-c
  70. echo -e "\033[1mInstalling xmlrpc-c\033[0m"
  71. ipkg install gcc binutils optware-devel libcurl-dev
  72. svn co http://xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/stable xmlrpc-c
  73. cd xmlrpc-c
  74. ./configure  --prefix=/opt
  75. make ARCH=arm
  76. make install

  77. #  ruTorrent 3.0
  78. echo -e "\033[1mInstalling ruTorrent\033[0m"
  79. cd /opt/share/www
  80. svn co http://rutorrent.googlecode.com/svn/trunk/rutorrent/
  81. cd rutorrent
  82. rm -r plugins
  83. svn co http://rutorrent.googlecode.com/svn/trunk/plugins/
  84. cd plugins
  85. rm -r darkpal rpc
  86. cd ..
  87. sed -i 's/scgi_port\s*=\s*5000/scgi_port = 5050/' conf/config.php

  88. echo -e "\033[1mAutoinstall complete\033[0m"
  89. reboot
复制代码



WIFIHELL | 万丰乐活 2020开启新的征程,好货不断!
gzrunman 发表于 2017-5-25 20:15:45 | 显示全部楼层
这个好办法哦。争取加分
WIFIHELL | 万丰乐活 2020开启新的征程,好货不断!
关闭

站点推荐上一条 /1 下一条

万丰乐活

GMT+8, 2024-6-16 06:27

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表