installation scripts for servers.
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.

28 lines
497 B

3 years ago
3 years ago
  1. #!/bin/sh
  2. # script must start at home directory
  3. cd "$HOME" || exit 1;
  4. #DIR="$(realpath "$(dirname "$0")")"
  5. usertest() {
  6. if test "$(id -u)" -ne 0; then
  7. echo "You must run this script as root.";
  8. exit 1;
  9. fi
  10. }
  11. createjunikim() {
  12. # create junikim
  13. adduser -g "Juni Kim" junikim
  14. adduser junikim video
  15. adduser junikim input
  16. adduser junikim wheel
  17. }
  18. installdoas() {
  19. apk add doas
  20. echo "permit persist :wheel" >> /etc/doas.d/doas.conf
  21. }
  22. usertest && createjunikim && installdoas