Skip to content

Commit d846270

Browse files
include options to choose between different version of ks files
1 parent eb802ef commit d846270

File tree

1 file changed

+36
-7
lines changed

1 file changed

+36
-7
lines changed

scripts/make_iso.sh

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
################################################################################
44
# Name : make_iso.sh #
55
# Author : Ibrahim Musayev #
6-
# Purpose : creates a new ISO image named Rocky-8-x86_64.iso and includes #
6+
# Purpose : creates a new ISO image named Rocky-9-x86_64.iso and includes #
77
# latest version of kickstart script. Also, The script provides #
88
# an interactive menu for the user to choose between generating #
99
# a new kickstart script or proceeding with an existing one. #
1010
# History : 15.05.23 Ibrahim Musayev, creation #
1111
################################################################################
1212

13-
iso_file="Rocky-8.9-x86_64-minimal.iso"
14-
new_iso_name="Rocky-8-9-x86_64-dvd.iso"
13+
iso_file="Rocky-9.4-x86_64-minimal.iso"
14+
new_iso_name="Rocky-9-4-x86_64-dvd.iso"
1515
downloads_dir="$HOME/Downloads"
1616
new_iso_dir=$downloads_dir/iso
1717
mnt_iso_dir="/mnt/iso"
1818
tmp_workdir="/tmp/workdir"
1919
tmp_workdir_iso="$tmp_workdir/iso"
2020
kickstart_dir="$tmp_workdir_iso/kickstart"
2121
python_replace_parameters="replace_parameters_in_ks_cfg.py"
22-
ks_cfg="iad1-ks-physical.cfg"
22+
ks_cfg="01_ams1-ks-physical-rocky-installation.cfg" #default
2323
isolinux_cfg="isolinux-rocky.cfg"
2424
user_mod=$(whoami)
2525

@@ -50,9 +50,38 @@ proceed_with_existing_kickstart_script() {
5050
else
5151
read -p "The kickstart script is currently set to '$ks_cfg'. Are you sure you want to continue with this script? (y/n): " confirm
5252
if [ "$confirm" != "y" ]; then
53-
read -p "Please provide a new name for the kickstart script: " ks_cfg
53+
echo "Please choose a kickstart script:"
54+
echo "1) 01_ams1-ks-physical-rocky-installation.cfg"
55+
echo "2) 02_fra1-ks-physical-rocky-installation.cfg"
56+
echo "3) 03_west1-ks-physical-rocky-installation.cfg"
57+
echo "4) 04_east1-ks-physical-rocky-installation.cfg"
58+
echo "5) Enter custom name"
59+
read -p "Enter your choice (1-5): " choice
60+
61+
case $choice in
62+
1)
63+
ks_cfg="01_ams1-ks-physical-rocky-installation.cfg"
64+
;;
65+
2)
66+
ks_cfg="02_fra1-ks-physical-rocky-installation.cfg"
67+
;;
68+
3)
69+
ks_cfg="03_west1-ks-physical-rocky-installation.cfg"
70+
;;
71+
4)
72+
ks_cfg="04_east1-ks-physical-rocky-installation.cfg"
73+
;;
74+
5)
75+
read -p "Please provide a new name for the kickstart script: " ks_cfg
76+
;;
77+
*)
78+
echo "Invalid choice. Please run the script again."
79+
exit 1
80+
;;
81+
esac
5482
fi
5583
fi
84+
echo "Using kickstart script: $ks_cfg"
5685
}
5786

5887
detect_python_command
@@ -120,7 +149,7 @@ if [ -f "$downloads_dir/$iso_file" ]; then
120149
if [ $? -eq 0 ]; then
121150
echo "Kickstart script copied successfully."
122151
echo "Creating a $new_iso_name File" && cd $tmp_workdir_iso
123-
sudo genisoimage -o $new_iso_name -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -V "Rocky 8 x86_64" -R -J -v -T .
152+
sudo genisoimage -o $new_iso_name -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -V "Rocky-9-x86_64" -R -J -v -T .
124153
if [ $? -eq 0 ]; then
125154
echo "$new_iso_name File successfully created..."
126155
sudo mv $new_iso_name $new_iso_dir
@@ -142,6 +171,6 @@ if [ -f "$downloads_dir/$iso_file" ]; then
142171
fi
143172
else
144173
echo "Please download the ISO file: $iso_file"
145-
echo "First you need a Rocky-8 ISO --> https://rockylinux.org/download/"
174+
echo "First you need a Rocky-9 ISO --> https://rockylinux.org/download/"
146175
exit 1
147176
fi

0 commit comments

Comments
 (0)