mirror of
https://github.com/angristan/openvpn-install.git
synced 2025-07-01 12:04:22 +02:00
Fix a bug with dpkg lock prevents apt commands run
This commit is contained in:
parent
423419de74
commit
5c16324a62
@ -99,8 +99,7 @@ function installUnbound() {
|
|||||||
if [[ ! -e /etc/unbound/unbound.conf ]]; then
|
if [[ ! -e /etc/unbound/unbound.conf ]]; then
|
||||||
|
|
||||||
if [[ $OS =~ (debian|ubuntu) ]]; then
|
if [[ $OS =~ (debian|ubuntu) ]]; then
|
||||||
apt-get install -y unbound
|
until apt-get install -y unbound; do sleep 1; done
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
echo 'interface: 10.8.0.1
|
echo 'interface: 10.8.0.1
|
||||||
access-control: 10.8.0.1/24 allow
|
access-control: 10.8.0.1/24 allow
|
||||||
@ -648,16 +647,16 @@ function installOpenVPN() {
|
|||||||
# the first time.
|
# the first time.
|
||||||
if [[ ! -e /etc/openvpn/server.conf ]]; then
|
if [[ ! -e /etc/openvpn/server.conf ]]; then
|
||||||
if [[ $OS =~ (debian|ubuntu) ]]; then
|
if [[ $OS =~ (debian|ubuntu) ]]; then
|
||||||
apt-get update
|
until apt-get update; do sleep 1; done
|
||||||
apt-get -y install ca-certificates gnupg
|
until apt-get -y install ca-certificates gnupg; do sleep 1; done
|
||||||
# We add the OpenVPN repo to get the latest version.
|
# We add the OpenVPN repo to get the latest version.
|
||||||
if [[ $VERSION_ID == "16.04" ]]; then
|
if [[ $VERSION_ID == "16.04" ]]; then
|
||||||
echo "deb http://build.openvpn.net/debian/openvpn/stable xenial main" >/etc/apt/sources.list.d/openvpn.list
|
echo "deb http://build.openvpn.net/debian/openvpn/stable xenial main" >/etc/apt/sources.list.d/openvpn.list
|
||||||
wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add -
|
wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add -
|
||||||
apt-get update
|
until apt-get update; do sleep 1; done
|
||||||
fi
|
fi
|
||||||
# Ubuntu > 16.04 and Debian > 8 have OpenVPN >= 2.4 without the need of a third party repository.
|
# Ubuntu > 16.04 and Debian > 8 have OpenVPN >= 2.4 without the need of a third party repository.
|
||||||
apt-get install -y openvpn iptables openssl wget ca-certificates curl
|
until apt-get install -y openvpn iptables openssl wget ca-certificates curl; do sleep 1; done
|
||||||
elif [[ $OS == 'centos' ]]; then
|
elif [[ $OS == 'centos' ]]; then
|
||||||
yum install -y epel-release
|
yum install -y epel-release
|
||||||
yum install -y openvpn iptables openssl wget ca-certificates curl tar 'policycoreutils-python*'
|
yum install -y openvpn iptables openssl wget ca-certificates curl tar 'policycoreutils-python*'
|
||||||
@ -1182,7 +1181,7 @@ function removeUnbound() {
|
|||||||
systemctl stop unbound
|
systemctl stop unbound
|
||||||
|
|
||||||
if [[ $OS =~ (debian|ubuntu) ]]; then
|
if [[ $OS =~ (debian|ubuntu) ]]; then
|
||||||
apt-get autoremove --purge -y unbound
|
until apt-get autoremove --purge -y unbound; do sleep 1; done
|
||||||
elif [[ $OS == 'arch' ]]; then
|
elif [[ $OS == 'arch' ]]; then
|
||||||
pacman --noconfirm -R unbound
|
pacman --noconfirm -R unbound
|
||||||
elif [[ $OS =~ (centos|amzn) ]]; then
|
elif [[ $OS =~ (centos|amzn) ]]; then
|
||||||
@ -1245,10 +1244,10 @@ function removeOpenVPN() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $OS =~ (debian|ubuntu) ]]; then
|
if [[ $OS =~ (debian|ubuntu) ]]; then
|
||||||
apt-get autoremove --purge -y openvpn
|
until apt-get autoremove --purge -y openvpn; do sleep 1; done
|
||||||
if [[ -e /etc/apt/sources.list.d/openvpn.list ]]; then
|
if [[ -e /etc/apt/sources.list.d/openvpn.list ]]; then
|
||||||
rm /etc/apt/sources.list.d/openvpn.list
|
rm /etc/apt/sources.list.d/openvpn.list
|
||||||
apt-get update
|
until apt-get update; do sleep 1; done
|
||||||
fi
|
fi
|
||||||
elif [[ $OS == 'arch' ]]; then
|
elif [[ $OS == 'arch' ]]; then
|
||||||
pacman --noconfirm -R openvpn
|
pacman --noconfirm -R openvpn
|
||||||
|
Loading…
x
Reference in New Issue
Block a user