Ignore shellcheck infos

This commit is contained in:
randomshell 2020-07-02 11:34:04 +00:00
parent 26e989cd2c
commit 8696a05131

View file

@ -29,9 +29,11 @@ function checkVirt() {
function checkOS() {
# Check OS version
if [[ -e /etc/debian_version ]]; then
# shellcheck disable=SC1091
source /etc/os-release
OS=$ID # debian or ubuntu
elif [[ -e /etc/fedora-release ]]; then
# shellcheck disable=SC1091
source /etc/os-release
OS=$ID
elif [[ -e /etc/centos-release ]]; then
@ -72,6 +74,7 @@ function installWireGuard() {
done
until [[ "$SERVER_WG_NIC" =~ ^[a-zA-Z0-9_]+$ ]]; do
# shellcheck disable=SC2034
read -rp "WireGuard interface name: " -e -i wg0 SERVER_WG_NIC
done
@ -145,6 +148,7 @@ PrivateKey = $SERVER_PRIV_KEY" >"/etc/wireguard/$SERVER_WG_NIC.conf"
if [ -x "$(command -v firewall-cmd)" ]; then
FIREWALLD_IPV4_ADDRESS=$(echo "$SERVER_WG_IPV4" | cut -d"." -f1-3)".0"
# shellcheck disable=SC2001
FIREWALLD_IPV6_ADDRESS=$(echo "$SERVER_WG_IPV6" | sed 's/:[^:]*$/:0/')
echo "PostUp = firewall-cmd --add-port $SERVER_PORT/udp && firewall-cmd --add-rich-rule='rule family=ipv4 source address=$FIREWALLD_IPV4_ADDRESS/24 masquerade' && firewall-cmd --add-rich-rule='rule family=ipv6 source address=$FIREWALLD_IPV6_ADDRESS/24 masquerade'
PostDown = firewall-cmd --remove-port $SERVER_PORT/udp && firewall-cmd --remove-rich-rule='rule family=ipv4 source address=$FIREWALLD_IPV4_ADDRESS/24 masquerade' && firewall-cmd --remove-rich-rule='rule family=ipv6 source address=$FIREWALLD_IPV6_ADDRESS/24 masquerade'" >>"/etc/wireguard/$SERVER_WG_NIC.conf"
@ -185,6 +189,7 @@ net.ipv6.conf.all.forwarding = 1" >/etc/sysctl.d/wg.conf
function newClient() {
# Load params
# shellcheck disable=SC1091
source /etc/wireguard/params
if [[ $SERVER_PUB_IP =~ .*:.* ]]; then