12.start_services.sh 484 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. # fail if any commands fails
  3. set -e
  4. # debug log
  5. #set -x
  6. # Set superuser privileges command if not set
  7. if [[ -z $su ]]; then
  8. export su="sudo"
  9. fi
  10. # start docker
  11. $su systemctl enable docker
  12. $su systemctl start docker
  13. # setup docker
  14. $su groupadd docker || true
  15. $su gpasswd -a $USER docker || true
  16. # start NTP
  17. $su systemctl enable ntpdate.service
  18. $su systemctl start ntpdate.service
  19. # start SSH daemon
  20. $su systemctl enable sshd.service
  21. $su systemctl start sshd.service