Install Aria2 on your NAS (Buffalo LS410D)

Ref: https://forum.xtdv.group/thread_101__huong_dan_cai_dat_aria2_va_aria2c_remote_control_de_download_direct_link_tren_nas

Pre-requisite:

  1. Open SSH
  2. Install IPKG

Install Aria2:

  1. Update Ipkg and install aria2
    • ipkg update

      ipkg install aria2

  2. Create folder aria2 in /opt/etc
    • mkdir /opt/etc/aria2

  3. Create a config file
    • nano /opt/etc/aria2/aria2.conf

  4. Copy code below to your file then Save it.
    • #!/bin/sh

      RETVAL=0

      case “$1” in
      start)
      echo -n “Starting aria2c daemon: ”
      umask 0000
      /opt/bin/aria2c –conf-path=/opt/etc/aria2/aria2.conf
      RETVAL=$?
      echo
      ;;
      stop)
      echo -n “Shutting down aria2c daemon: ”
      /usr/bin/killall aria2c
      RETVAL=$?
      echo
      ;;
      restart)
      stop
      sleep 3
      start
      ;;
      *)
      echo $”Usage: $0 {start|stop|restart}”
      RETVAL=1
      esac

      exit $RETVAL

Create configuration to let aria2 run when NAS start

  1. Create a aria2 config to setup aria2 run when NAS start.
    • nano /opt/etc/init.d/S90aria2

  2. Copy content below to file:
    • #!/bin/sh

      RETVAL=0

      case “$1” in
      start)
      echo -n “Starting aria2c daemon: ”
      umask 0000
      /opt/bin/aria2c –conf-path=/opt/etc/aria2/aria2.conf
      RETVAL=$?
      echo
      ;;
      stop)
      echo -n “Shutting down aria2c daemon: ”
      /usr/bin/killall aria2c
      RETVAL=$?
      echo
      ;;
      restart)
      stop
      sleep 3
      start
      ;;
      *)
      echo $”Usage: $0 {start|stop|restart}”
      RETVAL=1
      esac

      exit $RETVAL

  3. Set write permission
    • chmod 755 /opt/etc/init.d/S90aria2

  4. Reboot:
    • reboot

  5. Check if Aria2 is running:
    • /opt/etc/init.d/S90aria2 start

    • ps | grep aria2

Consider, when you change something of your /opt/etc/aria2/aria2.conf file you must enter a:

/opt/etc/init.d/S90aria2 restart