ffho-first-boot.sh 893 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/sh
  2. #
  3. # Maximilian Wilhelm <max@sdn.clinic>
  4. # -- Fri, 14 Apr 2023 22:05:24 +0200
  5. #
  6. while ! salt-call test.ping >/dev/null 2>&1; do
  7. echo "Please accept minion key on Salt master."
  8. sleep 10
  9. done
  10. echo "Looks like you did, cool, let's get started!"
  11. echo
  12. ################################################################################
  13. # Set up screeen and SSH #
  14. ################################################################################
  15. echo "Syncing modules..."
  16. salt-call saltutil.sync_all
  17. echo "Configuring screen and SSH..."
  18. salt-call state.apply screen,ssh
  19. echo "Backing up SSH keys..."
  20. cp -a /etc/ssh /opt
  21. cat << EOF
  22. SSH configured, you should now be able to SSH into this device (as root).
  23. EOF
  24. ip -br a
  25. echo
  26. echo
  27. echo "Running highstate..."
  28. salt-call state.highstate
  29. systemctl disable ffho-first-boot.service