1
0
mirror of synced 2024-11-21 20:46:10 +03:00

Add LXC check

This commit is contained in:
hwdsl2 2022-05-10 09:02:46 -05:00
parent 95d9fc4e03
commit 857c6b9bea
2 changed files with 24 additions and 0 deletions

View File

@ -64,6 +64,17 @@ check_vz() {
fi
}
check_lxc() {
# shellcheck disable=SC2154
if [ "$container" = "lxc" ] && [ ! -e /dev/ppp ]; then
cat 1>&2 <<'EOF'
Error: /dev/ppp is missing. LXC containers require configuration.
See: https://github.com/hwdsl2/setup-ipsec-vpn/issues/1014
EOF
exit 1
fi
}
check_os() {
os_type=centos
rh_file="/etc/redhat-release"
@ -705,6 +716,7 @@ EOF
vpnsetup() {
check_root
check_vz
check_lxc
check_os
check_iface
check_creds

View File

@ -63,6 +63,17 @@ check_vz() {
fi
}
check_lxc() {
# shellcheck disable=SC2154
if [ "$container" = "lxc" ] && [ ! -e /dev/ppp ]; then
cat 1>&2 <<'EOF'
Error: /dev/ppp is missing. LXC containers require configuration.
See: https://github.com/hwdsl2/setup-ipsec-vpn/issues/1014
EOF
exit 1
fi
}
check_os() {
os_type=$(lsb_release -si 2>/dev/null)
[ -z "$os_type" ] && [ -f /etc/os-release ] && os_type=$(. /etc/os-release && printf '%s' "$ID")
@ -677,6 +688,7 @@ EOF
vpnsetup() {
check_root
check_vz
check_lxc
check_os
check_iface
check_creds