Skip to content

Commit

Permalink
add os profiles for images
Browse files Browse the repository at this point in the history
  • Loading branch information
goffinet committed Jun 13, 2021
1 parent 6cbe4bd commit 6194a6d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
7 changes: 4 additions & 3 deletions define-guest-image-by-profile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ network=$2
profile=$3
mac=$5
parameters=$#
# almalinux8 bionic centos7 centos8 centos8-stream debian10 fedora32 fedora33 fedora34 focal kali20211 rocky8
if [[ $image = "bionic" ]] || [[ $image = "focal" ]] ; then
os="ubuntu18.04"
elif [[ $image = "debian10" ]] ; then
elif [[ $image = "debian10" ]] || [[ $image = "kali20211" ]] ; then
os="debian9"
elif [[ $image = "centos7" ]] || [[ $image = "centos8" ]] || [[ $image = "centos8" ]] ; then
elif [[ $image = "centos7" ]] || [[ $image = "centos8" ]] || [[ $image = "centos8-stream" ]] || [[ $image = "almalinux8" ]] || [[ $image = "rocky8" ]] ; then
os="centos7.0"
elif [[ $image = "fedora32" ]] || [[ $image = "fedora33" ]] ; then
elif [[ $image = "fedora32" ]] || [[ $image = "fedora33" ]] || [[ $image = "fedora34" ]] ; then
os="fedora28"
else
usage_message
Expand Down
21 changes: 17 additions & 4 deletions define-guest-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ graphics="none"
interface="virbr0"
model="virtio"
# osinfo-query os
if [ $image = "almalinux8.qcow2" ]; then
os="centos7.0"
fi
if [ $image = "bionic.qcow2" ]; then
os="ubuntu18.04"
fi
Expand All @@ -44,23 +47,33 @@ fi
if [ $image = "centos7.qcow2" ]; then
os="centos7.0"
fi
if [ $image = "focal.qcow2" ]; then
os="ubuntu18.04"
fi
if [ $image = "centos8.qcow2" ]; then
os="centos7.0"
fi
if [ $image = "focal.qcow2" ]; then
os="ubuntu18.04"
fi
if [ $image = "fedora32.qcow2" ]; then
os="fedora28"
fi
if [ $image = "fedora33.qcow2" ]; then
os="fedora28"
fi
if [ $image = "fedora34.qcow2" ]; then
os="fedora28"
fi
if [ $image = "rocky8.qcow2" ]; then
os="centos7.0"
fi
# Parameters for metasploitable guests
if [ $image = "metasploitable.qcow2" ]; then
diskbus="scsi"
model="e1000"
fi
# Parameters for Kali guests
if [ $image = "kali.qcow2" ]; then
if [ $image = "kali2021.qcow2" ]; then
memory="1024"
os="debian9"
fi
if [ $image = "gns3.qcow2" ]; then
memory="2048"
Expand Down
6 changes: 3 additions & 3 deletions deploy-image-by-profile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ mac=$5
parameters=$#
if [[ $image = "bionic" ]] || [[ $image = "focal" ]] ; then
os="ubuntu18.04"
elif [[ $image = "debian10" ]] ; then
elif [[ $image = "debian10" ]] || [[ $image = "kali20211" ]] ; then
os="debian9"
elif [[ $image = "centos7" ]] || [[ $image = "centos8" ]] || [[ $image = "centos8" ]] ; then
elif [[ $image = "centos7" ]] || [[ $image = "centos8" ]] || [[ $image = "centos8-stream" ]] || [[ $image = "almalinux8" ]] || [[ $image = "rocky8" ]] ; then
os="centos7.0"
elif [[ $image = "fedora32" ]] || [[ $image = "fedora33" ]] ; then
elif [[ $image = "fedora32" ]] || [[ $image = "fedora33" ]] || [[ $image = "fedora34" ]] ; then
os="fedora28"
else
usage_message
Expand Down

0 comments on commit 6194a6d

Please sign in to comment.