1
0
mirror of synced 2024-11-25 22:36:04 +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 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() { check_os() {
os_type=centos os_type=centos
rh_file="/etc/redhat-release" rh_file="/etc/redhat-release"
@ -705,6 +716,7 @@ EOF
vpnsetup() { vpnsetup() {
check_root check_root
check_vz check_vz
check_lxc
check_os check_os
check_iface check_iface
check_creds check_creds

View File

@ -63,6 +63,17 @@ check_vz() {
fi 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() { check_os() {
os_type=$(lsb_release -si 2>/dev/null) os_type=$(lsb_release -si 2>/dev/null)
[ -z "$os_type" ] && [ -f /etc/os-release ] && os_type=$(. /etc/os-release && printf '%s' "$ID") [ -z "$os_type" ] && [ -f /etc/os-release ] && os_type=$(. /etc/os-release && printf '%s' "$ID")
@ -677,6 +688,7 @@ EOF
vpnsetup() { vpnsetup() {
check_root check_root
check_vz check_vz
check_lxc
check_os check_os
check_iface check_iface
check_creds check_creds