Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. cat > "/etc/systemd/system/${1}.service" << EOF
  4. [Unit]
  5. Description=$2
  6. After=network-online.target
  7.  
  8. [Service]
  9. Type=simple
  10. User=%i
  11. ExecStart=$3
  12.  
  13. [Install]
  14. WantedBy=multi-user.target
  15. EOF
  16.  
  17. systemctl --system daemon-reload
  18. systemctl enable $1
  19. systemctl start $1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement