E:Option ==> debug
WireGuard ACTIVE Peer Status: Clients 0, Servers 0
1 = Update Wireguard modules 7 = Display QR code for a Peer {device} e.g. iPhone
2 = Remove WireGuard/wg_manager 8 = Peer management [ "list" | "category" | "new" ] | [ {Peer | category} [ del | show | add [{"auto="[y|n|p]}] ]
9 = Create Key-pair for Peer {Device} e.g. Nokia6310i (creates Nokia6310i.conf etc.)
3 = List ACTIVE Peers Summary [Peer...] [full] 10 = IPSet management [ "list" ] | [ "upd" { ipset [ "fwmark" {fwmark} ] | [ "enable" {"y"|"n"}] | [ "dstsrc"] ] } ]
4 = Start [ [Peer [nopolicy]...] | category ] e.g. start clients
5 = Stop [ [Peer... ] | category ] e.g. stop clients
6 = Restart [ [Peer... ] | category ] e.g. restart servers
? = About Configuration
v = View ('/jffs/addons/wireguard/WireguardVPN.conf')
e = Exit Script [?]
E
ebug mode enabledOption ==> import warp name= type=client
+ + sed s/^[ \t]*//;s/[ \t]*$//
printf %s import warp name= type=client
+ menu1=import warp name= type=client
+ Validate_User_Choice import warp name= type=client
+ local menu1=import warp name= type=client
+ [ Y == Y ]
+ echo import warp name= type=client
+ menu1=import warp name= type=client
+ Process_User_Choice import warp name= type=client
+ local menu1=import warp name= type=client
+ Import_Peer import warp name= type=client
+ local ACTION=import
+ shift
+ local WG_INTERFACE=warp
+ [ warp == ? ]
+ [ warp == dir ]
+ [ 3 -gt 0 ]
+ echo warp+ grep -F name=
+ [ -n ]
+ [ warp == tag= ]
+ [ warp == comment ]
+ echo+ grep -F type=
warp
+ [ -n ]
+ shift
+ [ 2 -gt 0 ]
+ echo+ grep -F name=
name=
+ [ -n name= ]
+ local RENAME=Y
+ echo name=
+ awk {print $0}
+ sed -n s/^.*name=//p
+ local NEW_NAME=
+ [ -z ]
+ [ -f /opt/etc/wireguard.d/wg11.conf ]
+ local NEW_NAME=wg11
+ break
+ [ name= == tag= ]
+ [ name= == comment ]
+ echo+ grep -F type=
name=
+ [ -n ]
+ shift
+ [ 1 -gt 0 ]
+ + grep -F name=
echo type=client
+ [ -n ]
+ [ type=client == tag= ]
+ [ type=client == comment ]
+ echo type=client
+ grep -F type=
+ [ -n type=client ]
+ echo type=client
+ sed -n s/^.*type=//p
+ awk {print $0}
+ local FORCE_TYPE=client
+ shift
+ [ 0 -gt 0 ]
+ [ warp = comment ]
+ [ -f /opt/etc/wireguard.d/warp.conf ]
+ Server_or_Client warp
+ local WG_INTERFACE=warp
+ local PEER_TYPE=
+ [ -f /opt/etc/wireguard.d/warp.conf ]
+ grep -iE ^Endpoint /opt/etc/wireguard.d/warp.conf
+ [ -n Endpoint = engage.cloudflareclient.com:2408 ]
+ nvram get ddns_hostname_x
+ grep -iF /opt/etc/wireguard.d/warp.conf
+ [ -z # Cloudflare Warp
[Interface]
PrivateKey = ePnDh+pQjs66xQRSXIsxyXexA+80NevCKjmEmO3ue1I=
Address = 172.16.0.2/32
DNS = 1.1.1.1
[Peer]
PublicKey = bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=
AllowedIPs = 0.0.0.0/0
Endpoint = engage.cloudflareclient.com:2408 ]
+ PEER_TYPE=device
+ echo device
+ local MODE=device
+ [ -n client ]
+ MODE=client
+ local FORCE_TYPE_TXT=(\e[91mFORCED as 'client'\e[0m) \e[92m
+ [ client != server ]
+ [ client == client ]
+ local TABLE=clients
+ local AUTO=Y
+ local KEY=peer
+ sqlite3 /opt/etc/wireguard.d/WireGuard.db SELECT peer FROM clients WHERE peer='warp';
+ [ -z ]
+ [ -z ]
+ grep -FB1 [Interface] /opt/etc/wireguard.d/warp.conf
+ grep -vF [Interface]
+ local ANNOTATE=# Cloudflare Warp
+ [ -z # Cloudflare Warp ]
+ local INSERT_COMMENT=N
+ echo # Cloudflare Warp+ sed s/'/''/g
+ local ANNOTATE=# Cloudflare Warp
+ printf %s+ sed s/^[ \t]*//;s/[ \t]*$//
# Cloudflare Warp
+ local ANNOTATE=# Cloudflare Warp
+ [ # != # ]
+ IFS= read -r LINE
+ IFS= read -r LINE
+ IFS= read -r LINE
+ local PRI_KEY=ePnDh+pQjs66xQRSXIsxyXexA+80NevCKjmEmO3ue1I=
+ IFS= read -r LINE
+ local SUBNET=172.16.0.2/32
+ [ client == client ]
+ COMMENT_OUT=Y
+ IFS= read -r LINE
+ local DNS=1.1.1.1
+ [ client == client ]
+ COMMENT_OUT=Y
+ IFS= read -r LINE
+ IFS= read -r LINE
+ IFS= read -r LINE
+ local PUB_KEY=bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=
+ IFS= read -r LINE
+ echo AllowedIPs = 0.0.0.0/0
+ awk {print $3}
+ local ALLOWIP=0.0.0.0/0
+ IFS= read -r LINE
+ local SOCKET=engage.cloudflareclient.com:2408
+ IFS= read -r LINE
+ [ -n ]
+ [ -f /opt/etc/wireguard.d/warp_public.key ]
+ [ -z 1.1.1.1 ]
+ [ -z 172.16.0.2/32 ]
+ nvram get ipv6_service
+ [ disabled == disabled ]
+ echo 172.16.0.2/32
+ tr ,
+ awk {print $1}
+ local SUBNET=172.16.0.2/32
+ echo 172.16.0.2/32+ Is_IPv4_CIDR
+ grep -oE ^([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}$
+ [ -z 172.16.0.2/32 ]
+ [ client = client ]
+ [ Y != Y ]
+ sqlite3 /opt/etc/wireguard.d/WireGuard.db INSERT INTO clients values('wg11','Y','172.16.0.2/32','engage.cloudflareclient.com:2408','1.1.1.1','bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=','ePnDh+pQjs66xQRSXIsxyXexA+80NevCKjmEmO3ue1I=','# Cloudflare Warp');
+ cp /opt/etc/wireguard.d/warp.conf /opt/etc/wireguard.d/warp.conf_imported
+ [ Y == Y ]
+ sed -i s/^DNS/#DNS/ /opt/etc/wireguard.d/warp.conf
+ sed -i s/^Address/#Address/ /opt/etc/wireguard.d/warp.conf
+ [ # Cloudflare Warp != # N/A ]
+ [ N != N ]
+ [ /opt/etc/wireguard.d/ != /opt/etc/wireguard.d/ ]
+ [ Y == Y ]
+ mv /opt/etc/wireguard.d/warp.conf /opt/etc/wireguard.d/wg11.conf
+ local AS_TXT=as \e[95mwg11 \e[0m
+ echo -e \e[92m\n\t[✔] Config \e[95mwarp\e[92m import as \e[95mwg11 \e[0m(\e[91mFORCED as 'client'\e[0m) \e[92msuccess\e[0m
[✔] Config warp import as wg11 (FORCED as 'client') success
+ local COMMENTOUT=
+ local RENAME=
+ local AS_TXT=
+ Manage_Peer
+ local ACTION=
+ shift
+ WG_INTERFACE=
+ shift
+ local CMD=
+ [ == new ]
+ [ == newC ]
+ [ == help ]
+ [ -z ]
+ CMD=list
+ echo
+ grep -iw ipset
+ [ -n ]
+ [ != category ]
+ Show_Peer_Config_Entry
+ local WG_INTERFACE=
+ echo -e \e[97m\n\tPeers (Auto=P - Policy, Auto=X - External i.e. Cell/Mobile)\e[96m
Peers (Auto=P - Policy, Auto=X - External i.e. Cell/Mobile)
+ COLUMN_TXT=Server,Auto,Subnet,Port,Annotate
+ sqlite3 /opt/etc/wireguard.d/WireGuard.db SELECT peer,auto,subnet,port,tag from servers;
+ column -t -s | --table-columns Server,Auto,Subnet,Port,Annotate
Server Auto Subnet Port Annotate
wg21 Y 10.50.1.1/24 51820 # RT-AC86U Server #1
+ echo -e
+ COLUMN_TXT=Client,Auto,IP,Endpoint,DNS,Annotate
+ sqlite3 /opt/etc/wireguard.d/WireGuard.db SELECT peer,auto,subnet,socket,dns,tag from clients;
+ column -t -s | --table-columns Client,Auto,IP,Endpoint,DNS,Annotate
Client Auto IP Endpoint DNS Annotate
wg11 Y 172.16.0.2/32 engage.cloudflareclient.com:2408 1.1.1.1 # Cloudflare Warp
+ echo -e
+ COLUMN_TXT=Device,Auto,IP,DNS,Allowed IP,Annotate
+ sqlite3 /opt/etc/wireguard.d/WireGuard.db SELECT name,auto,ip,dns,allowedip,tag from devices;
+ column -t -s | --table-columns Device,Auto,IP,DNS,Allowed IP,Annotate
+ echo -en \e[0m
+ set +x
WireGuard ACTIVE Peer Status: Clients 0, Servers 0
1 = Update Wireguard modules 7 = Display QR code for a Peer {device} e.g. iPhone
2 = Remove WireGuard/wg_manager 8 = Peer management [ "list" | "category" | "new" ] | [ {Peer | category} [ del | show | add [{"auto="[y|n|p]}] ]
9 = Create Key-pair for Peer {Device} e.g. Nokia6310i (creates Nokia6310i.conf etc.)
3 = List ACTIVE Peers Summary [Peer...] [full] 10 = IPSet management [ "list" ] | [ "upd" { ipset [ "fwmark" {fwmark} ] | [ "enable" {"y"|"n"}] | [ "dstsrc"] ] } ]
4 = Start [ [Peer [nopolicy]...] | category ] e.g. start clients
5 = Stop [ [Peer... ] | category ] e.g. stop clients
6 = Restart [ [Peer... ] | category ] e.g. restart servers
? = About Configuration
v = View ('/jffs/addons/wireguard/WireguardVPN.conf')
e = Exit Script [?]