Графический интерфейс в aria2c RPC http://blindage.org/?p=5385
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

hace 1 año
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>aria2g - GUI for aria2c JSON RPC server</title>
  6. </head>
  7. <body>
  8. <header><h1>Aria2g</h1></header>
  9. <summary>GUI for aria2c JSON-RPC server.</summary>
  10. <p style="float:right"><iframe allowtransparency="true" src="https://money.yandex.ru/embed/donate.xml?uid=41001643462408&amp;default-sum=100&amp;targets=%D0%9F%D0%BE%D0%B6%D0%B5%D1%80%D1%82%D0%B2%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5+%D0%BF%D1%80%D0%BE%D0%B5%D0%BA%D1%82%D1%83+Aria2G&amp;target-visibility=on&amp;project-name=Aria2g&amp;project-site=http%3A%2F%2Faria.blindage.org&amp;button-text=01&amp;hint=%D0%BD%D0%B0%D0%BF%D0%B8%D1%88%D0%B8%D1%82%D0%B5+%D1%87%D1%82%D0%BE+%D1%83%D0%B3%D0%BE%D0%B4%D0%BD%D0%BE+%3A)" frameborder="0" height="132" scrolling="no" width="450"></iframe></p>
  11. <article>
  12. <h2>About</h2>
  13. <p>Aria2g is a GUI for downloader aria2c. Opensource and crossplatform
  14. (Windows, Linux, FreeBSD, etc). Lazarus and FreePascal powered! Install
  15. and <a href="http://aria2.sourceforge.net/manual/en/html/aria2c.html#rpc-options">
  16. run aria2c rpc server</a> before you run aria2g. For example, <code>
  17. aria2c --enable-rpc=true --rpc-listen-all=true</code> (unsecured! only for home usage!).
  18. You can add remote servers to server list (in "Program" menu) and see remote downloads. You can download casual
  19. files, torrent and metalinks. Also you can upload text file with URLs and feed it to remote server.</p>
  20. <h2>Screenshots</h2>
  21. <p><a href="aria2g_mainwindow.png"><img src="aria2g_mainwindow_small.png" alt="aria2g screenshot"></a> <a href="aria2g_new_download.png"><img src="aria2g_new_download_small.png" alt="aria2g screenshot"></a></p>
  22. <p><a href="aria2g_windows.png"><img src="aria2g_windows_small.jpg" alt="aria2g screenshot"></a></p>
  23. <h2>Download</h2>
  24. <p>Sources repository <a href="https://dev.blindage.org/aria2g">https://dev.blindage.org/aria2g</a></p>
  25. <p>Binary downloads:
  26. <ul>
  27. <li><a href="http://aria.blindage.org/builds/aria2g_linux.tar.bz2">Linux i386 v.0.3.1</a></li>
  28. <li><a href="http://aria.blindage.org/builds/aria2g_installer_v0.3.2.6.exe">Windows i386 v.0.3.2.6 (exe installer)</a></li>
  29. </ul></p>
  30. <h2>Make aria2c work in daemon mode</h2>
  31. <pre>#! /bin/sh
  32. ### BEGIN INIT INFO
  33. # Provides: aria2c
  34. # Required-Start: $remote_fs $syslog
  35. # Required-Stop: $remote_fs $syslog
  36. # Default-Start: 2 3 4 5
  37. # Default-Stop: 0 1 6
  38. # Short-Description: Aria2c initscript
  39. # Description: This file should be used to construct scripts to be
  40. # placed in /etc/init.d.
  41. ### END INIT INFO
  42. # Author: Vladimir Smagin <21h@blindage.org>
  43. # Do NOT "set -e"
  44. PATH=/sbin:/usr/sbin:/bin:/usr/bin
  45. DESC="aria2c json rpc service"
  46. NAME=aria2c
  47. DAEMON=/usr/bin/aria2c
  48. DAEMON_ARGS="--rpc-listen-all=true --enable-rpc=true -D"
  49. PIDFILE=/var/run/$NAME.pid
  50. SCRIPTNAME=/etc/init.d/$NAME
  51. # Exit if the package is not installed
  52. [ -x "$DAEMON" ] || exit 0
  53. # Read configuration variable file if it is present
  54. [ -r /etc/default/$NAME ] && . /etc/default/$NAME
  55. # Load the VERBOSE setting and other rcS variables
  56. . /lib/init/vars.sh
  57. # Define LSB log_* functions.
  58. # Depend on lsb-base (>= 3.2-14) to ensure that this file is present
  59. # and status_of_proc is working.
  60. . /lib/lsb/init-functions
  61. #
  62. # Function that starts the daemon/service
  63. #
  64. do_start()
  65. {
  66. # Return
  67. # 0 if daemon has been started
  68. # 1 if daemon was already running
  69. # 2 if daemon could not be started
  70. start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
  71. || return 1
  72. start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
  73. $DAEMON_ARGS \
  74. || return 2
  75. # Add code here, if necessary, that waits for the process to be ready
  76. # to handle requests from services started subsequently which depend
  77. # on this one. As a last resort, sleep for some time.
  78. }
  79. #
  80. # Function that stops the daemon/service
  81. #
  82. do_stop()
  83. {
  84. # Return
  85. # 0 if daemon has been stopped
  86. # 1 if daemon was already stopped
  87. # 2 if daemon could not be stopped
  88. # other if a failure occurred
  89. start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
  90. RETVAL="$?"
  91. [ "$RETVAL" = 2 ] && return 2
  92. # Wait for children to finish too if this is a daemon that forks
  93. # and if the daemon is only ever run from this initscript.
  94. # If the above conditions are not satisfied then add some other code
  95. # that waits for the process to drop all resources that could be
  96. # needed by services started subsequently. A last resort is to
  97. # sleep for some time.
  98. start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
  99. [ "$?" = 2 ] && return 2
  100. # Many daemons don't delete their pidfiles when they exit.
  101. rm -f $PIDFILE
  102. return "$RETVAL"
  103. }
  104. #
  105. # Function that sends a SIGHUP to the daemon/service
  106. #
  107. do_reload() {
  108. #
  109. # If the daemon can reload its configuration without
  110. # restarting (for example, when it is sent a SIGHUP),
  111. # then implement that here.
  112. #
  113. start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
  114. return 0
  115. }
  116. case "$1" in
  117. start)
  118. [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
  119. do_start
  120. case "$?" in
  121. 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
  122. 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
  123. esac
  124. ;;
  125. stop)
  126. [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
  127. do_stop
  128. case "$?" in
  129. 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
  130. 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
  131. esac
  132. ;;
  133. status)
  134. status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
  135. ;;
  136. #reload|force-reload)
  137. #
  138. # If do_reload() is not implemented then leave this commented out
  139. # and leave 'force-reload' as an alias for 'restart'.
  140. #
  141. #log_daemon_msg "Reloading $DESC" "$NAME"
  142. #do_reload
  143. #log_end_msg $?
  144. #;;
  145. restart|force-reload)
  146. #
  147. # If the "reload" option is implemented then remove the
  148. # 'force-reload' alias
  149. #
  150. log_daemon_msg "Restarting $DESC" "$NAME"
  151. do_stop
  152. case "$?" in
  153. 0|1)
  154. do_start
  155. case "$?" in
  156. 0) log_end_msg 0 ;;
  157. 1) log_end_msg 1 ;; # Old process is still running
  158. *) log_end_msg 1 ;; # Failed to start
  159. esac
  160. ;;
  161. *)
  162. # Failed to stop
  163. log_end_msg 1
  164. ;;
  165. esac
  166. ;;
  167. *)
  168. #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
  169. echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
  170. exit 3
  171. ;;
  172. esac
  173. :
  174. </pre>
  175. put this script to /etc/init.d/aria2c and do <code>chmod +x /etc/init.d/aria2c</code>. For autostart do <code>sudo update-rc.d aria2c defaults</code>.
  176. <p align="center">Copyright by <a href="http://blindage.org">Vladimir Smagin</a>, 2013. Licensed under GPL.</p>
  177. </article>
  178. </body>
  179. </html>