mirror of
https://github.com/amnezia-vpn/amneziawg-tools.git
synced 2025-06-07 13:33:44 +02:00
Naming unify
This commit is contained in:
parent
a4aeb9e195
commit
8c1f047442
12 changed files with 91 additions and 34 deletions
|
@ -95,15 +95,16 @@ install: wg
|
||||||
@install -v -d "$(DESTDIR)$(BINDIR)" && install -v -m 0755 wg "$(DESTDIR)$(BINDIR)/awg"
|
@install -v -d "$(DESTDIR)$(BINDIR)" && install -v -m 0755 wg "$(DESTDIR)$(BINDIR)/awg"
|
||||||
@install -v -d "$(DESTDIR)$(MANDIR)/man8" && install -v -m 0644 man/wg.8 "$(DESTDIR)$(MANDIR)/man8/awg.8"
|
@install -v -d "$(DESTDIR)$(MANDIR)/man8" && install -v -m 0644 man/wg.8 "$(DESTDIR)$(MANDIR)/man8/awg.8"
|
||||||
@[ "$(WITH_BASHCOMPLETION)" = "yes" ] || exit 0; \
|
@[ "$(WITH_BASHCOMPLETION)" = "yes" ] || exit 0; \
|
||||||
install -v -d "$(DESTDIR)$(BASHCOMPDIR)" && install -v -m 0644 completion/wg.bash-completion "$(DESTDIR)$(BASHCOMPDIR)/awg"
|
install -v -d "$(DESTDIR)$(BASHCOMPDIR)" && install -v -m 0644 completion/wg.bash-completion "$(DESTDIR)$(BASHCOMPDIR)/awg/awg.bash-completion"
|
||||||
@[ "$(WITH_WGQUICK)" = "yes" ] || exit 0; \
|
@[ "$(WITH_WGQUICK)" = "yes" ] || exit 0; \
|
||||||
install -v -m 0755 wg-quick/$(PLATFORM).bash "$(DESTDIR)$(BINDIR)/awg-quick" && install -v -m 0700 -d "$(DESTDIR)$(SYSCONFDIR)/amnezia"
|
install -v -m 0755 wg-quick/$(PLATFORM).bash "$(DESTDIR)$(BINDIR)/awg-quick" && install -v -m 0700 -d "$(DESTDIR)$(SYSCONFDIR)/amnezia/amneziawg"
|
||||||
@[ "$(WITH_WGQUICK)" = "yes" ] || exit 0; \
|
@[ "$(WITH_WGQUICK)" = "yes" ] || exit 0; \
|
||||||
install -v -m 0644 man/wg-quick.8 "$(DESTDIR)$(MANDIR)/man8/awg-quick.8"
|
install -v -m 0644 man/wg-quick.8 "$(DESTDIR)$(MANDIR)/man8/awg-quick.8"
|
||||||
@[ "$(WITH_WGQUICK)" = "yes" -a "$(WITH_BASHCOMPLETION)" = "yes" ] || exit 0; \
|
@[ "$(WITH_WGQUICK)" = "yes" -a "$(WITH_BASHCOMPLETION)" = "yes" ] || exit 0; \
|
||||||
install -v -m 0644 completion/wg-quick.bash-completion "$(DESTDIR)$(BASHCOMPDIR)/awg-quick"
|
install -v -m 0644 completion/wg-quick.bash-completion "$(DESTDIR)$(BASHCOMPDIR)/awg-quick/awg-quick.bash-completion"
|
||||||
@[ "$(WITH_WGQUICK)" = "yes" -a "$(WITH_SYSTEMDUNITS)" = "yes" ] || exit 0; \
|
@[ "$(WITH_WGQUICK)" = "yes" -a "$(WITH_SYSTEMDUNITS)" = "yes" ] || exit 0; \
|
||||||
install -v -d "$(DESTDIR)$(SYSTEMDUNITDIR)" && install -v -m 0644 systemd/* "$(DESTDIR)$(SYSTEMDUNITDIR)/"
|
install -v -d "$(DESTDIR)$(SYSTEMDUNITDIR)" && install -v -m 0644 systemd/wg-quick.target "$(DESTDIR)$(SYSTEMDUNITDIR)/awg-quick.target" && \
|
||||||
|
install -v -m 0644 systemd/wg-quick@.service "$(DESTDIR)$(SYSTEMDUNITDIR)/awg-quick@.service"
|
||||||
|
|
||||||
check: clean
|
check: clean
|
||||||
scan-build --html-title=wireguard-tools -maxloop 100 --view --keep-going $(MAKE) wg
|
scan-build --html-title=wireguard-tools -maxloop 100 --view --keep-going $(MAKE) wg
|
||||||
|
|
|
@ -27,7 +27,7 @@ _awg_quick_completion() {
|
||||||
COMPREPLY+=( "${a[@]}" )
|
COMPREPLY+=( "${a[@]}" )
|
||||||
elif [[ ${COMP_WORDS[1]} == down ]]; then
|
elif [[ ${COMP_WORDS[1]} == down ]]; then
|
||||||
if [[ $OSTYPE == *openbsd* || $OSTYPE == *darwin* ]]; then
|
if [[ $OSTYPE == *openbsd* || $OSTYPE == *darwin* ]]; then
|
||||||
for i in /var/run/wireguard/*.name; do
|
for i in /var/run/amneziawg/*.name; do
|
||||||
i="${i##*/}"; i="${i%.name}"
|
i="${i##*/}"; i="${i%.name}"
|
||||||
mapfile -t a < <(compgen -W "$i" -- "${COMP_WORDS[2]}")
|
mapfile -t a < <(compgen -W "$i" -- "${COMP_WORDS[2]}")
|
||||||
COMPREPLY+=( "${a[@]}" )
|
COMPREPLY+=( "${a[@]}" )
|
|
@ -14,7 +14,7 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
|
||||||
#define SOCK_PATH RUNSTATEDIR "/wireguard/"
|
#define SOCK_PATH RUNSTATEDIR "/amneziawg/"
|
||||||
#define SOCK_SUFFIX ".sock"
|
#define SOCK_SUFFIX ".sock"
|
||||||
|
|
||||||
static FILE *userspace_interface_file(const char *iface)
|
static FILE *userspace_interface_file(const char *iface)
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
static bool is_exiting = false;
|
static bool is_exiting = false;
|
||||||
static bool binder_available = false;
|
static bool binder_available = false;
|
||||||
static unsigned int sdk_version;
|
static unsigned int sdk_version;
|
||||||
|
static bool is_asecurity_on = false;
|
||||||
|
|
||||||
static void *xmalloc(size_t size)
|
static void *xmalloc(size_t size)
|
||||||
{
|
{
|
||||||
|
@ -632,7 +633,10 @@ static void auto_su(int argc, char *argv[])
|
||||||
|
|
||||||
static void add_if(const char *iface)
|
static void add_if(const char *iface)
|
||||||
{
|
{
|
||||||
cmd("ip link add %s type wireguard", iface);
|
if (is_asecurity_on)
|
||||||
|
cmd("amneziawg-go %s", iface);
|
||||||
|
else
|
||||||
|
cmd("ip link add %s type wireguard", iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void del_if(const char *iface)
|
static void del_if(const char *iface)
|
||||||
|
@ -1256,6 +1260,24 @@ static void parse_options(char **iface, char **config, unsigned int *mtu, char *
|
||||||
} else if (!strncasecmp(clean, "MTU=", 4) && j > 4) {
|
} else if (!strncasecmp(clean, "MTU=", 4) && j > 4) {
|
||||||
*mtu = atoi(clean + 4);
|
*mtu = atoi(clean + 4);
|
||||||
continue;
|
continue;
|
||||||
|
} else if (!strncasecmp(clean, "Jc=", 3) && j > 4 {
|
||||||
|
is_asecurity_on = true;
|
||||||
|
} else if (!strncasecmp(clean, "Jmin=", 5) && j > 4 {
|
||||||
|
is_asecurity_on = true;
|
||||||
|
} else if (!strncasecmp(clean, "Jmax=", 5) && j > 4 {
|
||||||
|
is_asecurity_on = true;
|
||||||
|
} else if (!strncasecmp(clean, "S1=", 3) && j > 4 {
|
||||||
|
is_asecurity_on = true;
|
||||||
|
} else if (!strncasecmp(clean, "S2=", 3) && j > 4 {
|
||||||
|
is_asecurity_on = true;
|
||||||
|
} else if (!strncasecmp(clean, "H1=", 3) && j > 4 {
|
||||||
|
is_asecurity_on = true;
|
||||||
|
} else if (!strncasecmp(clean, "H2=", 3) && j > 4 {
|
||||||
|
is_asecurity_on = true;
|
||||||
|
} else if (!strncasecmp(clean, "H3=", 3) && j > 4 {
|
||||||
|
is_asecurity_on = true;
|
||||||
|
} else if (!strncasecmp(clean, "H4=", 3) && j > 4 {
|
||||||
|
is_asecurity_on = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*config = concat_and_free(*config, "", line);
|
*config = concat_and_free(*config, "", line);
|
||||||
|
@ -1300,4 +1322,4 @@ int main(int argc, char *argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
|
@ -41,7 +41,7 @@ die() {
|
||||||
|
|
||||||
[[ ${BASH_VERSINFO[0]} -ge 4 ]] || die "Version mismatch: bash ${BASH_VERSINFO[0]} detected, when bash 4+ required"
|
[[ ${BASH_VERSINFO[0]} -ge 4 ]] || die "Version mismatch: bash ${BASH_VERSINFO[0]} detected, when bash 4+ required"
|
||||||
|
|
||||||
CONFIG_SEARCH_PATHS=( /etc/wireguard /usr/local/etc/wireguard )
|
CONFIG_SEARCH_PATHS=( /etc/amnezia/amneziawg /usr/local/etc/amnezia/amneziawg )
|
||||||
|
|
||||||
parse_options() {
|
parse_options() {
|
||||||
local interface_section=0 line key value stripped path v
|
local interface_section=0 line key value stripped path v
|
||||||
|
@ -110,10 +110,10 @@ auto_su() {
|
||||||
get_real_interface() {
|
get_real_interface() {
|
||||||
local interface diff
|
local interface diff
|
||||||
wg show interfaces >/dev/null
|
wg show interfaces >/dev/null
|
||||||
[[ -f "/var/run/wireguard/$INTERFACE.name" ]] || return 1
|
[[ -f "/var/run/amneziawg/$INTERFACE.name" ]] || return 1
|
||||||
interface="$(< "/var/run/wireguard/$INTERFACE.name")"
|
interface="$(< "/var/run/amneziawg/$INTERFACE.name")"
|
||||||
[[ -n $interface && -S "/var/run/wireguard/$interface.sock" ]] || return 1
|
[[ -n $interface && -S "/var/run/amneziawg/$interface.sock" ]] || return 1
|
||||||
diff=$(( $(stat -f %m "/var/run/wireguard/$interface.sock" 2>/dev/null || echo 200) - $(stat -f %m "/var/run/wireguard/$INTERFACE.name" 2>/dev/null || echo 100) ))
|
diff=$(( $(stat -f %m "/var/run/amneziawg/$interface.sock" 2>/dev/null || echo 200) - $(stat -f %m "/var/run/wireguard/$INTERFACE.name" 2>/dev/null || echo 100) ))
|
||||||
[[ $diff -ge 2 || $diff -le -2 ]] && return 1
|
[[ $diff -ge 2 || $diff -le -2 ]] && return 1
|
||||||
REAL_INTERFACE="$interface"
|
REAL_INTERFACE="$interface"
|
||||||
echo "[+] Interface for $INTERFACE is $REAL_INTERFACE" >&2
|
echo "[+] Interface for $INTERFACE is $REAL_INTERFACE" >&2
|
||||||
|
@ -121,9 +121,9 @@ get_real_interface() {
|
||||||
}
|
}
|
||||||
|
|
||||||
add_if() {
|
add_if() {
|
||||||
export WG_TUN_NAME_FILE="/var/run/wireguard/$INTERFACE.name"
|
export WG_TUN_NAME_FILE="/var/run/amneziawg/$INTERFACE.name"
|
||||||
mkdir -p "/var/run/wireguard/"
|
mkdir -p "/var/run/amneziawg/"
|
||||||
cmd "${WG_QUICK_USERSPACE_IMPLEMENTATION:-wireguard-go}" utun
|
cmd "${WG_QUICK_USERSPACE_IMPLEMENTATION:-amneziawg-go}" utun
|
||||||
get_real_interface
|
get_real_interface
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -519,4 +519,4 @@ fi
|
||||||
|
|
||||||
[[ -n $LAUNCHED_BY_LAUNCHD ]] && wait
|
[[ -n $LAUNCHED_BY_LAUNCHD ]] && wait
|
||||||
|
|
||||||
exit 0
|
exit 0
|
|
@ -28,6 +28,8 @@ CONFIG_FILE=""
|
||||||
PROGRAM="${0##*/}"
|
PROGRAM="${0##*/}"
|
||||||
ARGS=( "$@" )
|
ARGS=( "$@" )
|
||||||
|
|
||||||
|
IS_ASESCURITY_ON=0
|
||||||
|
|
||||||
cmd() {
|
cmd() {
|
||||||
echo "[#] $*" >&3
|
echo "[#] $*" >&3
|
||||||
"$@"
|
"$@"
|
||||||
|
@ -38,7 +40,7 @@ die() {
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
CONFIG_SEARCH_PATHS=( /etc/wireguard /usr/local/etc/wireguard )
|
CONFIG_SEARCH_PATHS=( /etc/amnezia/amneziawg /usr/local/etc/amnezia/amneziawg )
|
||||||
|
|
||||||
unset ORIGINAL_TMPDIR
|
unset ORIGINAL_TMPDIR
|
||||||
make_temp() {
|
make_temp() {
|
||||||
|
@ -96,6 +98,17 @@ parse_options() {
|
||||||
PostDown) POST_DOWN+=( "$value" ); continue ;;
|
PostDown) POST_DOWN+=( "$value" ); continue ;;
|
||||||
SaveConfig) read_bool SAVE_CONFIG "$value"; continue ;;
|
SaveConfig) read_bool SAVE_CONFIG "$value"; continue ;;
|
||||||
esac
|
esac
|
||||||
|
case "$key" in
|
||||||
|
Jc);&
|
||||||
|
Jmin);&
|
||||||
|
Jmax);&
|
||||||
|
S1);&
|
||||||
|
S2);&
|
||||||
|
H1);&
|
||||||
|
H2);&
|
||||||
|
H3);&
|
||||||
|
H4) IS_ASESCURITY_ON=1;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
WG_CONFIG+="$line"$'\n'
|
WG_CONFIG+="$line"$'\n'
|
||||||
done < "$CONFIG_FILE"
|
done < "$CONFIG_FILE"
|
||||||
|
@ -116,7 +129,11 @@ auto_su() {
|
||||||
|
|
||||||
add_if() {
|
add_if() {
|
||||||
local ret rc
|
local ret rc
|
||||||
if ret="$(cmd ifconfig wg create name "$INTERFACE" 2>&1 >/dev/null)"; then
|
local cmd="ifconfig wg create name "$INTERFACE""
|
||||||
|
if [[ $IS_ASESCURITY_ON == 1 ]]; then
|
||||||
|
cmd="amneziawg-go "$INTERFACE"";
|
||||||
|
fi
|
||||||
|
if ret="$(cmd $cmd 2>&1 >/dev/null)"; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
rc=$?
|
rc=$?
|
||||||
|
@ -125,7 +142,7 @@ add_if() {
|
||||||
return $rc
|
return $rc
|
||||||
fi
|
fi
|
||||||
echo "[!] Missing WireGuard kernel support ($ret). Falling back to slow userspace implementation." >&3
|
echo "[!] Missing WireGuard kernel support ($ret). Falling back to slow userspace implementation." >&3
|
||||||
cmd "${WG_QUICK_USERSPACE_IMPLEMENTATION:-wireguard-go}" "$INTERFACE"
|
cmd "${WG_QUICK_USERSPACE_IMPLEMENTATION:-amneziawg-go}" "$INTERFACE"
|
||||||
}
|
}
|
||||||
|
|
||||||
del_routes() {
|
del_routes() {
|
||||||
|
@ -154,8 +171,8 @@ del_routes() {
|
||||||
|
|
||||||
del_if() {
|
del_if() {
|
||||||
[[ $HAVE_SET_DNS -eq 0 ]] || unset_dns
|
[[ $HAVE_SET_DNS -eq 0 ]] || unset_dns
|
||||||
if [[ -S /var/run/wireguard/$INTERFACE.sock ]]; then
|
if [[ -S /var/run/amneziawg/$INTERFACE.sock ]]; then
|
||||||
cmd rm -f "/var/run/wireguard/$INTERFACE.sock"
|
cmd rm -f "/var/run/amneziawg/$INTERFACE.sock"
|
||||||
else
|
else
|
||||||
cmd ifconfig "$INTERFACE" destroy
|
cmd ifconfig "$INTERFACE" destroy
|
||||||
fi
|
fi
|
||||||
|
@ -484,4 +501,4 @@ else
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
|
@ -40,7 +40,7 @@ die() {
|
||||||
parse_options() {
|
parse_options() {
|
||||||
local interface_section=0 line key value stripped v
|
local interface_section=0 line key value stripped v
|
||||||
CONFIG_FILE="$1"
|
CONFIG_FILE="$1"
|
||||||
[[ $CONFIG_FILE =~ ^[a-zA-Z0-9_=+.-]{1,15}$ ]] && CONFIG_FILE="/etc/amnezia/$CONFIG_FILE.conf"
|
[[ $CONFIG_FILE =~ ^[a-zA-Z0-9_=+.-]{1,15}$ ]] && CONFIG_FILE="/etc/amnezia/amneziawg/$CONFIG_FILE.conf"
|
||||||
[[ -e $CONFIG_FILE ]] || die "\`$CONFIG_FILE' does not exist"
|
[[ -e $CONFIG_FILE ]] || die "\`$CONFIG_FILE' does not exist"
|
||||||
[[ $CONFIG_FILE =~ (^|/)([a-zA-Z0-9_=+.-]{1,15})\.conf$ ]] || die "The config file must be a valid interface name, followed by .conf"
|
[[ $CONFIG_FILE =~ (^|/)([a-zA-Z0-9_=+.-]{1,15})\.conf$ ]] || die "The config file must be a valid interface name, followed by .conf"
|
||||||
CONFIG_FILE="$(readlink -f "$CONFIG_FILE")"
|
CONFIG_FILE="$(readlink -f "$CONFIG_FILE")"
|
||||||
|
@ -91,7 +91,7 @@ add_if() {
|
||||||
ret=$?
|
ret=$?
|
||||||
[[ -e /sys/module/amneziawg ]] || ! command -v "${WG_QUICK_USERSPACE_IMPLEMENTATION:-amneziawg-go}" >/dev/null && exit $ret
|
[[ -e /sys/module/amneziawg ]] || ! command -v "${WG_QUICK_USERSPACE_IMPLEMENTATION:-amneziawg-go}" >/dev/null && exit $ret
|
||||||
echo "[!] Missing WireGuard (Amnezia VPN) kernel module. Falling back to slow userspace implementation." >&2
|
echo "[!] Missing WireGuard (Amnezia VPN) kernel module. Falling back to slow userspace implementation." >&2
|
||||||
cmd "${WG_QUICK_USERSPACE_IMPLEMENTATION:-wireguard-go}" "$INTERFACE"
|
cmd "${WG_QUICK_USERSPACE_IMPLEMENTATION:-amneziawg-go}" "$INTERFACE"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ SAVE_CONFIG=0
|
||||||
CONFIG_FILE=""
|
CONFIG_FILE=""
|
||||||
PROGRAM="${0##*/}"
|
PROGRAM="${0##*/}"
|
||||||
ARGS=( "$@" )
|
ARGS=( "$@" )
|
||||||
|
IS_ASESCURITY_ON=0
|
||||||
|
|
||||||
cmd() {
|
cmd() {
|
||||||
echo "[#] $*" >&3
|
echo "[#] $*" >&3
|
||||||
|
@ -41,7 +42,7 @@ die() {
|
||||||
parse_options() {
|
parse_options() {
|
||||||
local interface_section=0 line key value stripped
|
local interface_section=0 line key value stripped
|
||||||
CONFIG_FILE="$1"
|
CONFIG_FILE="$1"
|
||||||
[[ $CONFIG_FILE =~ ^[a-zA-Z0-9_=+.-]{1,15}$ ]] && CONFIG_FILE="/etc/wireguard/$CONFIG_FILE.conf"
|
[[ $CONFIG_FILE =~ ^[a-zA-Z0-9_=+.-]{1,15}$ ]] && CONFIG_FILE="/etc/amnezia/amneziawg/$CONFIG_FILE.conf"
|
||||||
[[ -e $CONFIG_FILE ]] || die "\`$CONFIG_FILE' does not exist"
|
[[ -e $CONFIG_FILE ]] || die "\`$CONFIG_FILE' does not exist"
|
||||||
[[ $CONFIG_FILE =~ (^|/)([a-zA-Z0-9_=+.-]{1,15})\.conf$ ]] || die "The config file must be a valid interface name, followed by .conf"
|
[[ $CONFIG_FILE =~ (^|/)([a-zA-Z0-9_=+.-]{1,15})\.conf$ ]] || die "The config file must be a valid interface name, followed by .conf"
|
||||||
CONFIG_FILE="$(readlink -f "$CONFIG_FILE")"
|
CONFIG_FILE="$(readlink -f "$CONFIG_FILE")"
|
||||||
|
@ -68,6 +69,17 @@ parse_options() {
|
||||||
PostDown) POST_DOWN+=( "$value" ); continue ;;
|
PostDown) POST_DOWN+=( "$value" ); continue ;;
|
||||||
SaveConfig) read_bool SAVE_CONFIG "$value"; continue ;;
|
SaveConfig) read_bool SAVE_CONFIG "$value"; continue ;;
|
||||||
esac
|
esac
|
||||||
|
case "$key" in
|
||||||
|
Jc);&
|
||||||
|
Jmin);&
|
||||||
|
Jmax);&
|
||||||
|
S1);&
|
||||||
|
S2);&
|
||||||
|
H1);&
|
||||||
|
H2);&
|
||||||
|
H3);&
|
||||||
|
H4) IS_ASESCURITY_ON=1;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
WG_CONFIG+="$line"$'\n'
|
WG_CONFIG+="$line"$'\n'
|
||||||
done < "$CONFIG_FILE"
|
done < "$CONFIG_FILE"
|
||||||
|
@ -106,14 +118,19 @@ add_if() {
|
||||||
while true; do
|
while true; do
|
||||||
local -A existing_ifs="( $(wg show interfaces | sed 's/\([^ ]*\)/[\1]=1/g') )"
|
local -A existing_ifs="( $(wg show interfaces | sed 's/\([^ ]*\)/[\1]=1/g') )"
|
||||||
local index ret
|
local index ret
|
||||||
for ((index=0; index <= 2147483647; ++index)); do [[ -v existing_ifs[wg$index] ]] || break; done
|
if [[ $IS_ASESCURITY_ON == 1 ]]; then
|
||||||
if ret="$(cmd ifconfig wg$index create description "wg-quick: $INTERFACE" 2>&1)"; then
|
cmd "amneziawg-go "$INTERFACE"";
|
||||||
REAL_INTERFACE="wg$index"
|
return $?
|
||||||
return 0
|
else
|
||||||
|
for ((index=0; index <= 2147483647; ++index)); do [[ -v existing_ifs[wg$index] ]] || break; done
|
||||||
|
if ret="$(cmd ifconfig wg$index create description "wg-quick: $INTERFACE" 2>&1)"; then
|
||||||
|
REAL_INTERFACE="wg$index"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
[[ $ret == *"ifconfig: SIOCIFCREATE: File exists"* ]] && continue
|
||||||
|
echo "$ret" >&3
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
[[ $ret == *"ifconfig: SIOCIFCREATE: File exists"* ]] && continue
|
|
||||||
echo "$ret" >&3
|
|
||||||
return 1
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -478,4 +495,4 @@ else
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
Loading…
Add table
Reference in a new issue