Add Oracle Linux

- Add support for Oracle Linux 8 and 7.
This commit is contained in:
hwdsl2 2022-03-20 23:10:11 -05:00
parent 9e58aace48
commit 629b39d3b3
8 changed files with 60 additions and 30 deletions

View File

@ -41,6 +41,7 @@ check_os() {
if grep -qs "Red Hat" "$rh_file"; then if grep -qs "Red Hat" "$rh_file"; then
os_type=rhel os_type=rhel
fi fi
[ -f /etc/oracle-release ] && os_type=ol
if grep -qs "release 7" "$rh_file"; then if grep -qs "release 7" "$rh_file"; then
os_ver=7 os_ver=7
elif grep -qs "release 8" "$rh_file"; then elif grep -qs "release 8" "$rh_file"; then
@ -70,8 +71,8 @@ check_os() {
*) *)
cat 1>&2 <<'EOF' cat 1>&2 <<'EOF'
Error: This script only supports one of the following OS: Error: This script only supports one of the following OS:
Ubuntu, Debian, CentOS/RHEL 7/8, Rocky Linux, AlmaLinux, Ubuntu, Debian, CentOS/RHEL, Rocky Linux, AlmaLinux,
Amazon Linux 2 or Alpine Linux Oracle Linux, Amazon Linux 2 or Alpine Linux
EOF EOF
exit 1 exit 1
;; ;;

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# #
# Script to set up and manage IKEv2 on Ubuntu, Debian, CentOS/RHEL, # Script to set up and manage IKEv2 on Ubuntu, Debian, CentOS/RHEL, Rocky Linux,
# Rocky Linux, AlmaLinux, Amazon Linux 2 and Alpine Linux # AlmaLinux, Oracle Linux, Amazon Linux 2 and Alpine Linux
# #
# DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC! # DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC!
# #
@ -52,6 +52,7 @@ check_os() {
if grep -qs "Red Hat" "$rh_file"; then if grep -qs "Red Hat" "$rh_file"; then
os_type=rhel os_type=rhel
fi fi
[ -f /etc/oracle-release ] && os_type=ol
if grep -qs "release 7" "$rh_file"; then if grep -qs "release 7" "$rh_file"; then
os_ver=7 os_ver=7
elif grep -qs "release 8" "$rh_file"; then elif grep -qs "release 8" "$rh_file"; then
@ -81,8 +82,8 @@ check_os() {
*) *)
cat 1>&2 <<'EOF' cat 1>&2 <<'EOF'
Error: This script only supports one of the following OS: Error: This script only supports one of the following OS:
Ubuntu, Debian, CentOS/RHEL 7/8, Rocky Linux, AlmaLinux, Ubuntu, Debian, CentOS/RHEL, Rocky Linux, AlmaLinux,
Amazon Linux 2 or Alpine Linux Oracle Linux, Amazon Linux 2 or Alpine Linux
EOF EOF
exit 1 exit 1
;; ;;

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# #
# Quick start script to set up an IPsec VPN server on Ubuntu, Debian, # Quick start script to set up an IPsec VPN server on Ubuntu, Debian, CentOS/RHEL,
# CentOS/RHEL, Rocky Linux, AlmaLinux, Amazon Linux 2 and Alpine Linux # Rocky Linux, AlmaLinux, Oracle Linux, Amazon Linux 2 and Alpine Linux
# Works on any dedicated server or virtual private server (VPS) # Works on any dedicated server or virtual private server (VPS)
# #
# DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC! # DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC!
@ -77,6 +77,7 @@ check_os() {
if grep -qs "Red Hat" "$rh_file"; then if grep -qs "Red Hat" "$rh_file"; then
os_type=rhel os_type=rhel
fi fi
[ -f /etc/oracle-release ] && os_type=ol
if grep -qs "release 7" "$rh_file"; then if grep -qs "release 7" "$rh_file"; then
os_ver=7 os_ver=7
elif grep -qs "release 8" "$rh_file"; then elif grep -qs "release 8" "$rh_file"; then
@ -109,8 +110,8 @@ check_os() {
*) *)
cat 1>&2 <<'EOF' cat 1>&2 <<'EOF'
Error: This script only supports one of the following OS: Error: This script only supports one of the following OS:
Ubuntu, Debian, CentOS/RHEL 7/8, Rocky Linux, AlmaLinux, Ubuntu, Debian, CentOS/RHEL, Rocky Linux, AlmaLinux,
Amazon Linux 2 or Alpine Linux Oracle Linux, Amazon Linux 2 or Alpine Linux
EOF EOF
exit 1 exit 1
;; ;;
@ -254,7 +255,8 @@ install_pkgs() {
get_setup_url() { get_setup_url() {
base_url="https://github.com/hwdsl2/setup-ipsec-vpn/raw/master" base_url="https://github.com/hwdsl2/setup-ipsec-vpn/raw/master"
sh_file="vpnsetup_ubuntu.sh" sh_file="vpnsetup_ubuntu.sh"
if [ "$os_type" = "centos" ] || [ "$os_type" = "rhel" ] || [ "$os_type" = "rocky" ] || [ "$os_type" = "alma" ]; then if [ "$os_type" = "centos" ] || [ "$os_type" = "rhel" ] || [ "$os_type" = "rocky" ] \
|| [ "$os_type" = "alma" ] || [ "$os_type" = "ol" ]; then
sh_file="vpnsetup_centos.sh" sh_file="vpnsetup_centos.sh"
elif [ "$os_type" = "amzn" ]; then elif [ "$os_type" = "amzn" ]; then
sh_file="vpnsetup_amzn.sh" sh_file="vpnsetup_amzn.sh"

View File

@ -1,7 +1,6 @@
#!/bin/bash #!/bin/bash
# #
# Script to uninstall IPsec VPN on Ubuntu, Debian, CentOS/RHEL, # Script to uninstall IPsec VPN
# Rocky Linux, AlmaLinux, Amazon Linux 2 and Alpine Linux
# #
# DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC! # DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC!
# #
@ -40,6 +39,7 @@ check_os() {
if grep -qs "Red Hat" "$rh_file"; then if grep -qs "Red Hat" "$rh_file"; then
os_type=rhel os_type=rhel
fi fi
[ -f /etc/oracle-release ] && os_type=ol
if grep -qs "release 7" "$rh_file" || grep -qs "release 8" "$rh_file"; then if grep -qs "release 7" "$rh_file" || grep -qs "release 8" "$rh_file"; then
grep -qi rocky "$rh_file" && os_type=rocky grep -qi rocky "$rh_file" && os_type=rocky
grep -qi alma "$rh_file" && os_type=alma grep -qi alma "$rh_file" && os_type=alma
@ -64,8 +64,8 @@ check_os() {
*) *)
cat 1>&2 <<'EOF' cat 1>&2 <<'EOF'
Error: This script only supports one of the following OS: Error: This script only supports one of the following OS:
Ubuntu, Debian, CentOS/RHEL 7/8, Rocky Linux, AlmaLinux, Ubuntu, Debian, CentOS/RHEL, Rocky Linux, AlmaLinux,
Amazon Linux 2 or Alpine Linux Oracle Linux, Amazon Linux 2 or Alpine Linux
EOF EOF
exit 1 exit 1
;; ;;

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# #
# Script to update Libreswan on Ubuntu, Debian, CentOS/RHEL, Rocky Linux, # Script to update Libreswan on Ubuntu, Debian, CentOS/RHEL, Rocky Linux,
# AlmaLinux, Amazon Linux 2 and Alpine Linux # AlmaLinux, Oracle Linux, Amazon Linux 2 and Alpine Linux
# #
# The latest version of this script is available at: # The latest version of this script is available at:
# https://github.com/hwdsl2/setup-ipsec-vpn # https://github.com/hwdsl2/setup-ipsec-vpn
@ -42,6 +42,7 @@ check_os() {
if grep -qs "Red Hat" "$rh_file"; then if grep -qs "Red Hat" "$rh_file"; then
os_type=rhel os_type=rhel
fi fi
[ -f /etc/oracle-release ] && os_type=ol
if grep -qs "release 7" "$rh_file"; then if grep -qs "release 7" "$rh_file"; then
os_ver=7 os_ver=7
elif grep -qs "release 8" "$rh_file"; then elif grep -qs "release 8" "$rh_file"; then
@ -74,8 +75,8 @@ check_os() {
*) *)
cat 1>&2 <<'EOF' cat 1>&2 <<'EOF'
Error: This script only supports one of the following OS: Error: This script only supports one of the following OS:
Ubuntu, Debian, CentOS/RHEL 7/8, Rocky Linux, AlmaLinux, Ubuntu, Debian, CentOS/RHEL, Rocky Linux, AlmaLinux,
Amazon Linux 2 or Alpine Linux Oracle Linux, Amazon Linux 2 or Alpine Linux
EOF EOF
exit 1 exit 1
;; ;;
@ -135,7 +136,8 @@ install_pkgs() {
get_setup_url() { get_setup_url() {
base_url="https://github.com/hwdsl2/setup-ipsec-vpn/raw/master/extras" base_url="https://github.com/hwdsl2/setup-ipsec-vpn/raw/master/extras"
sh_file="vpnupgrade_ubuntu.sh" sh_file="vpnupgrade_ubuntu.sh"
if [ "$os_type" = "centos" ] || [ "$os_type" = "rhel" ] || [ "$os_type" = "rocky" ] || [ "$os_type" = "alma" ]; then if [ "$os_type" = "centos" ] || [ "$os_type" = "rhel" ] || [ "$os_type" = "rocky" ] \
|| [ "$os_type" = "alma" ] || [ "$os_type" = "ol" ]; then
sh_file="vpnupgrade_centos.sh" sh_file="vpnupgrade_centos.sh"
elif [ "$os_type" = "amzn" ]; then elif [ "$os_type" = "amzn" ]; then
sh_file="vpnupgrade_amzn.sh" sh_file="vpnupgrade_amzn.sh"

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# #
# Script to update Libreswan on CentOS/RHEL, Rocky Linux and AlmaLinux # Script to update Libreswan on CentOS/RHEL, Rocky Linux, AlmaLinux and Oracle Linux
# #
# The latest version of this script is available at: # The latest version of this script is available at:
# https://github.com/hwdsl2/setup-ipsec-vpn # https://github.com/hwdsl2/setup-ipsec-vpn
@ -45,6 +45,7 @@ check_os() {
if grep -qs "Red Hat" "$rh_file"; then if grep -qs "Red Hat" "$rh_file"; then
os_type=rhel os_type=rhel
fi fi
[ -f /etc/oracle-release ] && os_type=ol
if grep -qs "release 7" "$rh_file"; then if grep -qs "release 7" "$rh_file"; then
os_ver=7 os_ver=7
elif grep -qs "release 8" "$rh_file"; then elif grep -qs "release 8" "$rh_file"; then
@ -56,7 +57,11 @@ check_os() {
exiterr "CentOS Linux 8 is EOL and not supported." exiterr "CentOS Linux 8 is EOL and not supported."
fi fi
else else
exiterr "This script only supports CentOS/RHEL 7/8, Rocky Linux and AlmaLinux." cat 1>&2 <<'EOF'
Error: This script only supports one of the following OS:
CentOS/RHEL, Rocky Linux, AlmaLinux or Oracle Linux
EOF
exit 1
fi fi
} }
@ -162,6 +167,12 @@ install_pkgs_2() {
rp1="$erp=*server-*optional*" rp1="$erp=*server-*optional*"
rp2="$erp=*releases-optional*" rp2="$erp=*releases-optional*"
rp3="$erp=[Pp]ower[Tt]ools" rp3="$erp=[Pp]ower[Tt]ools"
if [ "$os_type" = "ol" ] && [ "$os_ver" = "8" ]; then
rp3="$erp=ol8_codeready_builder"
fi
if [ "$os_type" = "ol" ] && [ "$os_ver" = "7" ]; then
rp2="$erp=ol7_optional_latest"
fi
[ "$os_type" = "rhel" ] && rp3="$erp=codeready-builder-for-rhel-8-*" [ "$os_type" = "rhel" ] && rp3="$erp=codeready-builder-for-rhel-8-*"
if [ "$os_ver" = "7" ]; then if [ "$os_ver" = "7" ]; then
( (

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# #
# Script for automatic setup of an IPsec VPN server on Ubuntu, Debian, # Script for automatic setup of an IPsec VPN server on Ubuntu, Debian, CentOS/RHEL,
# CentOS/RHEL, Rocky Linux, AlmaLinux, Amazon Linux 2 and Alpine Linux # Rocky Linux, AlmaLinux, Oracle Linux, Amazon Linux 2 and Alpine Linux
# Works on any dedicated server or virtual private server (VPS) # Works on any dedicated server or virtual private server (VPS)
# #
# DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC! # DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC!
@ -77,6 +77,7 @@ check_os() {
if grep -qs "Red Hat" "$rh_file"; then if grep -qs "Red Hat" "$rh_file"; then
os_type=rhel os_type=rhel
fi fi
[ -f /etc/oracle-release ] && os_type=ol
if grep -qs "release 7" "$rh_file"; then if grep -qs "release 7" "$rh_file"; then
os_ver=7 os_ver=7
elif grep -qs "release 8" "$rh_file"; then elif grep -qs "release 8" "$rh_file"; then
@ -109,8 +110,8 @@ check_os() {
*) *)
cat 1>&2 <<'EOF' cat 1>&2 <<'EOF'
Error: This script only supports one of the following OS: Error: This script only supports one of the following OS:
Ubuntu, Debian, CentOS/RHEL 7/8, Rocky Linux, AlmaLinux, Ubuntu, Debian, CentOS/RHEL, Rocky Linux, AlmaLinux,
Amazon Linux 2 or Alpine Linux Oracle Linux, Amazon Linux 2 or Alpine Linux
EOF EOF
exit 1 exit 1
;; ;;
@ -254,7 +255,8 @@ install_pkgs() {
get_setup_url() { get_setup_url() {
base_url="https://github.com/hwdsl2/setup-ipsec-vpn/raw/master" base_url="https://github.com/hwdsl2/setup-ipsec-vpn/raw/master"
sh_file="vpnsetup_ubuntu.sh" sh_file="vpnsetup_ubuntu.sh"
if [ "$os_type" = "centos" ] || [ "$os_type" = "rhel" ] || [ "$os_type" = "rocky" ] || [ "$os_type" = "alma" ]; then if [ "$os_type" = "centos" ] || [ "$os_type" = "rhel" ] || [ "$os_type" = "rocky" ] \
|| [ "$os_type" = "alma" ] || [ "$os_type" = "ol" ]; then
sh_file="vpnsetup_centos.sh" sh_file="vpnsetup_centos.sh"
elif [ "$os_type" = "amzn" ]; then elif [ "$os_type" = "amzn" ]; then
sh_file="vpnsetup_amzn.sh" sh_file="vpnsetup_amzn.sh"

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# #
# Script for automatic setup of an IPsec VPN server on CentOS/RHEL, # Script for automatic setup of an IPsec VPN server on CentOS/RHEL, Rocky Linux,
# Rocky Linux and AlmaLinux # AlmaLinux and Oracle Linux
# Works on any dedicated server or virtual private server (VPS) # Works on any dedicated server or virtual private server (VPS)
# #
# DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC! # DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC!
@ -71,6 +71,7 @@ check_os() {
if grep -qs "Red Hat" "$rh_file"; then if grep -qs "Red Hat" "$rh_file"; then
os_type=rhel os_type=rhel
fi fi
[ -f /etc/oracle-release ] && os_type=ol
if grep -qs "release 7" "$rh_file"; then if grep -qs "release 7" "$rh_file"; then
os_ver=7 os_ver=7
elif grep -qs "release 8" "$rh_file"; then elif grep -qs "release 8" "$rh_file"; then
@ -82,7 +83,11 @@ check_os() {
exiterr "CentOS Linux 8 is EOL and not supported." exiterr "CentOS Linux 8 is EOL and not supported."
fi fi
else else
exiterr "This script only supports CentOS/RHEL 7/8, Rocky Linux and AlmaLinux." cat 1>&2 <<'EOF'
Error: This script only supports one of the following OS:
CentOS/RHEL, Rocky Linux, AlmaLinux or Oracle Linux
EOF
exit 1
fi fi
} }
@ -197,8 +202,14 @@ install_vpn_pkgs_1() {
rp2="$erp=*server-*optional*" rp2="$erp=*server-*optional*"
rp3="$erp=*releases-optional*" rp3="$erp=*releases-optional*"
rp4="$erp=[Pp]ower[Tt]ools" rp4="$erp=[Pp]ower[Tt]ools"
if [ "$os_type" = "ol" ] && [ "$os_ver" = "8" ]; then
rp1="$erp=ol8_developer_EPEL"
rp4="$erp=ol8_codeready_builder"
fi
if [ "$os_type" = "ol" ] && [ "$os_ver" = "7" ]; then
rp3="$erp=ol7_optional_latest"
fi
[ "$os_type" = "rhel" ] && rp4="$erp=codeready-builder-for-rhel-8-*" [ "$os_type" = "rhel" ] && rp4="$erp=codeready-builder-for-rhel-8-*"
( (
set -x set -x
yum -y -q install nss-devel nspr-devel pkgconfig pam-devel \ yum -y -q install nss-devel nspr-devel pkgconfig pam-devel \