-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
50 lines (40 loc) · 1.21 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# Determine the script's directory
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
# Source the root check script
source "$SCRIPT_DIR/scripts/common/check_root.sh"
echo "Running setup scripts..."
# Execute all scripts in the scripts directory
for script in ./scripts/*.sh; do
if [[ $script != "./scripts/common/check_root.sh" && $script != "./scripts/common/load_config.sh" ]]; then
echo "Running $script..."
bash "$script"
fi
done
echo "Initial Setup complete."
# Prompt to run optional scripts
echo "Would you like to run optional scripts? (y/n)"
read -r response
if [[ "$response" == "y" || "$response" == "Y" ]]; then
echo "Select optional scripts to run:"
echo "1) Install Docker"
echo "Enter the numbers of the scripts you want to run, separated by spaces (e.g., '1 n'):"
read -r scripts_to_run
for script in $scripts_to_run; do
case $script in
1)
"$SCRIPT_DIR/optional-scripts/setup_docker.sh"
;;
*)
echo "Invalid option: $script"
;;
esac
done
fi
# Prompt to reboot the system
echo "Would you like to reboot the system now? (y/n)"
read -r response
if [[ "$response" == "y" || "$response" == "Y" ]]; then
echo "Rebooting..."
reboot
fi