You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
934 B

  1. #!/bin/sh /etc/rc.common
  2. # Copyright (C) 2017 OpenWrt.org
  3. USE_PROCD=1
  4. START=90
  5. STOP=10
  6. PROG=/usr/sbin/i2pd
  7. USER="i2pd"
  8. GROUP="i2pd"
  9. PIDFILE=/var/run/i2pd.pid
  10. DATADIR=/var/lib/i2pd
  11. start_service() {
  12. ## RAM
  13. if [ ! -d $DATADIR ]; then
  14. mkdir -p $DATADIR
  15. ln -s /usr/share/i2pd/certificates $DATADIR/certificates
  16. ln -s /etc/i2pd/tunnels.conf $DATADIR/tunnels.conf
  17. # for peoples who not possible to use http reseeding
  18. ln -s /etc/i2pd/addressbook $DATADIR/addressbook
  19. fi
  20. ## We need permissions
  21. chown $USER:$GROUP $DATADIR
  22. touch $PIDFILE
  23. chown $USER:adm $PIDFILE
  24. procd_open_instance
  25. procd_set_param command $PROG --service --conf=/etc/i2pd/i2pd.conf --pidfile $PIDFILE
  26. ## Don't know about i2pd user's HOME
  27. procd_set_param env HOME=$DATADIR
  28. procd_set_param limits nofile=4096
  29. procd_set_param stdout 1
  30. procd_set_param stderr 1
  31. procd_set_param user $USER
  32. procd_set_param pidfile $PIDFILE
  33. procd_close_instance
  34. }