Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Oracle Linux 8. #810

Merged
merged 4 commits into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Support for Oracle Linux 8.
  • Loading branch information
rvva committed Mar 14, 2021
commit e299a247a0d19b1400e87803e1699584519ec14f
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
![Lint](https://github.com/angristan/openvpn-install/workflows/Lint/badge.svg)
![visitors](https://visitor-badge.glitch.me/badge?page_id=angristan.openvpn-install)

OpenVPN installer for Debian, Ubuntu, Fedora, CentOS and Arch Linux.
OpenVPN installer for Debian, Ubuntu, Fedora, CentOS, Oracle Linux 8 and Arch Linux.
rvva marked this conversation as resolved.
Show resolved Hide resolved

This script will let you setup your own secure VPN server in just a few seconds.

Expand Down Expand Up @@ -125,6 +125,7 @@ The script supports these OS and architectures:
| Fedora >= 27 | ❔ | ✅ | ❔ | ❔ |
| Ubuntu 16.04 | ✅ | ✅ | ❌ | ❌ |
| Ubuntu >= 18.04 | ✅ | ✅ | ✅ | ✅ |
| Oracle Linux 8 | ❌ | ✅ | ❌ | ❔ |

To be noted:

Expand Down
28 changes: 20 additions & 8 deletions openvpn-install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck disable=SC1091,SC2164,SC2034,SC1072,SC1073,SC1009

# Secure OpenVPN server installer for Debian, Ubuntu, CentOS, Amazon Linux 2, Fedora and Arch Linux
# Secure OpenVPN server installer for Debian, Ubuntu, CentOS, Amazon Linux 2, Fedora, Oracle Linux 8 and Arch Linux
# https://github.com/angristan/openvpn-install

function isRoot() {
Expand Down Expand Up @@ -65,6 +65,15 @@ function checkOS() {
exit 1
fi
fi
if [[ $ID == "oracle" ]]; then
rvva marked this conversation as resolved.
Show resolved Hide resolved
OS="oracle"
if [[ ! $VERSION_ID =~ (8) ]]; then
echo "Your version of Oracle Linux is not supported."
echo ""
echo "The script only support Oracle Linux 8."
exit 1
fi
fi
if [[ $ID == "amzn" ]]; then
OS="amzn"
if [[ $VERSION_ID != "2" ]]; then
Expand All @@ -78,7 +87,7 @@ function checkOS() {
elif [[ -e /etc/arch-release ]]; then
OS=arch
else
echo "Looks like you aren't running this installer on a Debian, Ubuntu, Fedora, CentOS, Amazon Linux 2 or Arch Linux system"
echo "Looks like you aren't running this installer on a Debian, Ubuntu, Fedora, CentOS, Amazon Linux 2, Oracle Linux 8 or Arch Linux system"
exit 1
fi
}
Expand Down Expand Up @@ -110,7 +119,7 @@ hide-version: yes
use-caps-for-id: yes
prefetch: yes' >>/etc/unbound/unbound.conf

elif [[ $OS =~ (centos|amzn) ]]; then
elif [[ $OS =~ (centos|amzn|oracle) ]]; then
yum install -y unbound

# Configuration
Expand Down Expand Up @@ -165,7 +174,7 @@ prefetch: yes' >>/etc/unbound/unbound.conf
access-control: fd42:42:42:42::/112 allow' >>/etc/unbound/unbound.conf
fi

if [[ ! $OS =~ (fedora|centos|amzn) ]]; then
if [[ ! $OS =~ (fedora|centos|amzn|oracle) ]]; then
# DNS Rebinding fix
echo "private-address: 10.0.0.0/8
private-address: fd42:42:42:42::/112
Expand Down Expand Up @@ -665,6 +674,9 @@ function installOpenVPN() {
elif [[ $OS == 'centos' ]]; then
yum install -y epel-release
yum install -y openvpn iptables openssl wget ca-certificates curl tar 'policycoreutils-python*'
elif [[ $OS == 'oracle' ]]; then
yum install -y 'oracle-epel-release-*'
yum install -y openvpn iptables openssl wget ca-certificates curl tar 'policycoreutils-python*'
elif [[ $OS == 'amzn' ]]; then
amazon-linux-extras install -y epel
yum install -y openvpn iptables openssl wget ca-certificates curl
Expand Down Expand Up @@ -909,7 +921,7 @@ verb 3" >>/etc/openvpn/server.conf
fi

# Finally, restart and enable OpenVPN
if [[ $OS == 'arch' || $OS == 'fedora' || $OS == 'centos' ]]; then
if [[ $OS == 'arch' || $OS == 'fedora' || $OS == 'centos'|| $OS == 'oracle' ]]; then
# Don't modify package-provided service
cp /usr/lib/systemd/system/openvpn-server@.service /etc/systemd/system/openvpn-server@.service

Expand Down Expand Up @@ -1197,7 +1209,7 @@ function removeUnbound() {
apt-get remove --purge -y unbound
elif [[ $OS == 'arch' ]]; then
pacman --noconfirm -R unbound
elif [[ $OS =~ (centos|amzn) ]]; then
elif [[ $OS =~ (centos|amzn|oracle) ]]; then
yum remove -y unbound
elif [[ $OS == 'fedora' ]]; then
dnf remove -y unbound
Expand All @@ -1223,7 +1235,7 @@ function removeOpenVPN() {
PROTOCOL=$(grep '^proto ' /etc/openvpn/server.conf | cut -d " " -f 2)

# Stop OpenVPN
if [[ $OS =~ (fedora|arch|centos) ]]; then
if [[ $OS =~ (fedora|arch|centos|oracle) ]]; then
systemctl disable openvpn-server@server
systemctl stop openvpn-server@server
# Remove customised service
Expand Down Expand Up @@ -1264,7 +1276,7 @@ function removeOpenVPN() {
fi
elif [[ $OS == 'arch' ]]; then
pacman --noconfirm -R openvpn
elif [[ $OS =~ (centos|amzn) ]]; then
elif [[ $OS =~ (centos|amzn|oracle) ]]; then
yum remove -y openvpn
elif [[ $OS == 'fedora' ]]; then
dnf remove -y openvpn
Expand Down