Advertisement
Guest User

Untitled

a guest
Nov 12th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. # add start script /etc/init.d/iobroker
  2. echo "############### add start script /etc/init.d/iobroker ###############"
  3.  
  4. sudo cat <<- EOF > /etc/init.d/iobroker
  5. #!/bin/bash
  6. ### BEGIN INIT INFO
  7. # Provides: iobroker
  8. # Required-Start: \$network \$local_fs \$remote_fs
  9. # Required-Stop: \$network \$local_fs \$remote_fs
  10. # Default-Start: 2 3 4 5
  11. # Default-Stop: 0 1 6
  12. # Short-Description: starts ioBroker
  13. # Description: starts ioBroker
  14. ### END INIT INFO
  15. source /etc/profile
  16. source /etc/skel/.bashrc
  17. source /etc/skel/.profile
  18. (( EUID )) && echo .You need to have root privileges.. && exit 1
  19. PIDF=/opt/iobroker/node_modules/iobroker.js-controller/lib/iobroker.pid
  20. #NODECMD=/usr/local/bin/node
  21. NODECMD=/usr/bin/node
  22. IOBROKERCMD=/opt/iobroker/node_modules/iobroker.js-controller/iobroker.js
  23. RETVAL=0
  24. IOBROKERUSER=iobroker
  25. # Starting ioBroker
  26. export IOBROKER_HOME=/opt/iobroker
  27. echo -n "Starting ioBroker"
  28. sudo -u \${IOBROKERUSER} \$NODECMD \$IOBROKERCMD start
  29. EOF
  30.  
  31.  
  32.  
  33.  
  34. # add service script /etc/systemd/system/iobroker.service
  35. echo "############### add service script /etc/systemd/system/iobroker.service ###############"
  36.  
  37. sudo cat <<- EOF > /etc/systemd/system/iobroker.service
  38. #
  39. # Start ioBroker Daemon
  40. #
  41. # /etc/systemd/system/iobroker.service
  42. # Invoking scripts to start/shutdown ioBroker
  43. [Unit]
  44. Description=ioBroker server task
  45. Requires=network.target
  46. [Service]
  47. User=iobroker
  48. Type=forking
  49. RemainAfterExit=yes
  50. Restart=no
  51. ExecStart=/etc/init.d/iobroker
  52. [Install]
  53. WantedBy=multi-user.target
  54. EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement