Commit 9beb3933 authored by girerd's avatar girerd

Add Support Oracle Linux

parent b8d2131f
......@@ -4,7 +4,7 @@ progname="ug-master2instance"
current_hostname="$(cat /etc/hostname)"
os_id=$(. /etc/os-release; echo ${ID})
os_versionid=$(. /etc/os-release; echo ${VERSION_ID})
if [[ "${os_id}" = "rhel" || "${os_id}" = "centos" ]]; then
if [[ "${os_id}" = "rhel" || "${os_id}" = "centos" || "${os_id}" = "ol" ]]; then
ssh_service_name="sshd"
else
ssh_service_name="ssh"
......@@ -49,7 +49,7 @@ function tab()
function is_installed
{
case "${os_id}" in
rhel|centos) rpm -q "$1" 1>/dev/null 2>&1;;
rhel|centos|ol) rpm -q "$1" 1>/dev/null 2>&1;;
debian) dpkg -l "$1" 1>/dev/null 2>&1;;
*) false;;
esac
......@@ -111,7 +111,7 @@ function change_hostname
pb " - regenerate the ssh_host_*"
dpkg-reconfigure openssh-server 2>&1 | tab 5
pg " Done !"
elif [[ "${os_id}" = "rhel" || "${os_id}" = "centos" ]]; then
elif [[ "${os_id}" = "rhel" || "${os_id}" = "centos" || "${os_id}" = "ol" ]]; then
pb " regenerate the ssh_host_* by restarting sshd"
systemctl restart ${ssh_service_name} 2>&1 | tab 5
pg " Done !"
......@@ -170,7 +170,7 @@ function construct_ug_static_ipv46
echo "Domains=unige.ch"
echo ""
echo "${lip_dns}" | tr "," "\n" | sed 's|^|DNS=|'
elif [[ "${os_id}" = "rhel" || "${os_id}" = "centos" ]]; then
elif [[ "${os_id}" = "rhel" || "${os_id}" = "centos" || "${os_id}" = "ol" ]]; then
printf 'TYPE="Ethernet"\n'
printf 'PROXY_METHOD="none"\n'
printf 'BROWSER_ONLY="no"\n'
......@@ -211,7 +211,7 @@ function change_network
dev_interface="$(ls -1 -- /sys/class/net/ | grep -vP '^docker\d*|^veth*|^lo$' | head -1)"
if [[ "${os_id}" = "debian" ]]; then
network_path="/etc/systemd/network/ug-static-ipv46.network"
elif [[ "${os_id}" = "rhel" || "${os_id}" = "centos" ]]; then
elif [[ "${os_id}" = "rhel" || "${os_id}" = "centos" || "${os_id}" = "ol" ]]; then
network_path="/etc/sysconfig/network-scripts/ifcfg-${dev_interface}"
fi
......@@ -317,7 +317,7 @@ function clean_up
pb " - rm -f /etc/sudoers.d/vmgars"
rm -f /etc/sudoers.d/vmgars
# To avoid a bug in VMWare API for a VM in Centos 7
if [[ "${os_id}" = "centos" ]]; then
if [[ "${os_id}" = "centos" || "${os_id}" = "ol" ]]; then
pb " - at in 5min: userdel -rf vmgars"
at now + 5 minutes <<EOF
userdel -rf vmgars >/dev/null 2>&1
......@@ -338,7 +338,7 @@ function expand_disk
if [[ -f /usr/local/bin/ug-expand-disk ]]; then
pb "expand_disk"
/usr/local/bin/ug-expand-disk
elif [[ "${os_id}" = "rhel" || "${os_id}" = "centos" ]]; then
elif [[ "${os_id}" = "rhel" || "${os_id}" = "centos" || "${os_id}" = "ol" ]]; then
pb "expand_disk sda2"
pvresize /dev/sda2
fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment