Improve warning message, fix checking for wrong OS
This commit is contained in:
parent
756f49aba4
commit
64887413eb
1 changed files with 16 additions and 15 deletions
|
|
@ -554,29 +554,30 @@ function installOpenVPN () {
|
||||||
yum install epel-release openvpn iptables openssl wget ca-certificates curl -y
|
yum install epel-release openvpn iptables openssl wget ca-certificates curl -y
|
||||||
elif [[ "$OS" = 'fedora' ]]; then
|
elif [[ "$OS" = 'fedora' ]]; then
|
||||||
dnf install openvpn iptables openssl wget ca-certificates curl -y
|
dnf install openvpn iptables openssl wget ca-certificates curl -y
|
||||||
elif [[ "$OS" = 'archlinux' ]]; then
|
elif [[ "$OS" = 'arch' ]]; then
|
||||||
# Else, the distro is ArchLinux
|
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
echo "WARNING: As you're using ArchLinux, I need to update the packages on your system to install those I need."
|
||||||
echo "As you're using ArchLinux, I need to update the packages on your system to install those I need."
|
echo "Not doing that could cause problems between dependencies, or missing files in repositories (Arch Linux does not support partial upgrades)."
|
||||||
echo "Not doing that could cause problems between dependencies, or missing files in repositories."
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Continuing will update your installed packages and install needed ones."
|
echo "Continuing will update your installed packages and install needed ones."
|
||||||
|
echo ""
|
||||||
until [[ $CONTINUE == "y" || $CONTINUE == "n" ]]; do
|
until [[ $CONTINUE == "y" || $CONTINUE == "n" ]]; do
|
||||||
read -rp "Continue ? [y/n]: " -e -i y CONTINUE
|
read -rp "Continue ? [y/n]: " -e -i y CONTINUE
|
||||||
done
|
done
|
||||||
if [[ "$CONTINUE" = "n" ]]; then
|
if [[ "$CONTINUE" = "n" ]]; then
|
||||||
echo "Ok, bye !"
|
echo "Exiting because user did not permit updating the system."
|
||||||
exit 4
|
exit 4
|
||||||
fi
|
fi
|
||||||
if [[ "$OS" = 'arch' ]]; then
|
|
||||||
# Install dependencies
|
# Install required dependencies and upgrade the system
|
||||||
pacman --needed --noconfirm -Syu openvpn iptables openssl wget ca-certificates curl
|
pacman --needed --noconfirm -Syu openvpn iptables openssl wget ca-certificates curl
|
||||||
iptables-save > /etc/iptables/iptables.rules # iptables won't start if this file does not exist
|
|
||||||
systemctl daemon-reload
|
# iptables service won't start if this file does not exist
|
||||||
systemctl enable iptables
|
touch /etc/iptables/iptables.rules
|
||||||
systemctl start iptables
|
|
||||||
fi
|
# Enable iptables service
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl enable --now iptables
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Find out if the machine uses nogroup or nobody for the permissionless group
|
# Find out if the machine uses nogroup or nobody for the permissionless group
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue