#! bin/bash interpreter=$(ps -p $$ | awk '$1 != "PID" {print $(NF)}' | tr -d '()') if [ "$interpreter" != "bash" ]; then echo "Please run with bash. (\`./rocky-preconfig.sh\` or \`bash rocky-preconfig.sh\`)" echo "Current interpreter: $interpreter" exit 1 fi euid=$(id -u) if [[ "$euid" != 0 ]]; then echo "Please run as root or with sudo." exit 1 fi welcome() { local response cat < .rocky-preconfig.progress ;& 1) echo "################################################################################" install_epel_release echo 2 > .rocky-preconfig.progress ;& 2) echo "################################################################################" selinux_permissive echo 3 > .rocky-preconfig.progress ;& 3) echo "################################################################################" houston_configuration echo 4 > .rocky-preconfig.progress ;& 4) echo "################################################################################" update_system echo 5 > .rocky-preconfig.progress ;& 5) echo "################################################################################" setup_done echo 6 > .rocky-preconfig.progress ;& 6) echo "Setup successfully finished the previous time running this script." ;; esac exit 0