~fkooman/vpn-maint-scripts

ref: 1.2.0 vpn-maint-scripts/bin/vpn-maint-update-system -rwxr-xr-x 1005 bytes
ed277a5eFrançois Kooman update CHANGES 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh

if ! [ "root" = "$(id -u -n)" ]; then
    echo "ERROR: ${0} must be run as root!"; exit 1
fi

systemctl stop openvpn-server@\* --all

if [ -f /etc/fedora-release ]; then
    systemctl stop httpd
    systemctl stop php-fpm
    dnf -y --refresh update
    systemctl start php-fpm
    systemctl start httpd
elif [ -f /etc/centos-release ] || [ -f /etc/redhat-release ]; then
    systemctl stop httpd
    systemctl stop php-fpm
    yum clean expire-cache
    yum -y update
    systemctl start php-fpm
    systemctl start httpd
elif [ -f /etc/debian_version ]; then
    PHP_VERSION=$(/usr/sbin/phpquery -V)
    systemctl stop apache2
    systemctl stop "php${PHP_VERSION}-fpm"
    apt-get update
    # debconf(7)
    DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade
    systemctl start "php${PHP_VERSION}-fpm"
    systemctl start apache2
else
    echo "ERROR: OS not supported!"
    exit 1
fi

rm -rf /etc/openvpn/server/*
vpn-server-node-server-config
systemctl start openvpn-server@\* --all