~fkooman/vpn-maint-scripts

ref: baf47953d26ea1e08b952479d97947594ab5c50c vpn-maint-scripts/bin/vpn-maint-update-node -rwxr-xr-x 610 bytes
baf47953François Kooman update paths for new Debian packages 3 months 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
#!/bin/sh

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

rm -rf /etc/openvpn/server/*
rm -rf /etc/wireguard/*

if [ -f /etc/fedora-release ]; then
    dnf -y --refresh update
    /usr/libexec/vpn-server-node/server-config
elif [ -f /etc/centos-release ] || [ -f /etc/redhat-release ]; then
    yum clean expire-cache
    yum -y update
    /usr/libexec/vpn-server-node/server-config
elif [ -f /etc/debian_version ]; then
    apt update
    apt -y dist-upgrade
    /usr/libexec/vpn-server-node/server-config
else 
    echo "ERROR: OS not supported!"
    exit 1
fi