1
0
mirror of synced 2024-11-22 04:56:03 +03:00

Add container check

- Add check for LXC containers. Ref: #1014
This commit is contained in:
hwdsl2 2021-09-18 00:53:15 -05:00
parent 328e78e9a0
commit c8db38f12b
2 changed files with 24 additions and 0 deletions

View File

@ -33,6 +33,17 @@ check_vz() {
fi
}
check_lxc() {
# shellcheck disable=SC2154
if [ "$container" = "lxc" ] && [ ! -e /dev/ppp ]; then
cat >&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"
@ -201,6 +212,7 @@ run_setup() {
quickstart() {
check_root
check_vz
check_lxc
check_os
check_iface
check_iptables

View File

@ -55,6 +55,17 @@ check_vz() {
fi
}
check_lxc() {
# shellcheck disable=SC2154
if [ "$container" = "lxc" ] && [ ! -e /dev/ppp ]; then
cat >&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"
@ -252,6 +263,7 @@ run_setup() {
vpnsetup() {
check_root
check_vz
check_lxc
check_os
check_iface
check_creds