[VTUN] Change search default interface

pull/320/head
Igor Zalatov (from Citadel PC) 2022-08-07 12:07:56 +03:00
parent 023995a428
commit 1578aed840
1 changed files with 4 additions and 4 deletions
general/package/vtund-openipc/files

View File

@ -1,23 +1,23 @@
#!/bin/sh #!/bin/sh
# #
# OpenIPC.org | v.20220712 # OpenIPC.org | v.20220806
# by Igor Zalatov, aka FlyRouter, aka ZigFisher # by Igor Zalatov, aka FlyRouter, aka ZigFisher
# Busybox applets: awk cat echo insmod ip modprobe sha1sum sleep tr tunctl udhcpc uptime # Busybox applets: awk cat echo insmod ip modprobe sha1sum sleep tr tunctl udhcpc uptime
# #
vtund_enable="1" vtund_enable="1"
vtund_port="5000"
vtund_server=$1 vtund_server=$1
vtund_server=${vtund_server:=vtun.localhost} vtund_server=${vtund_server:=vtun.localhost}
vtund_source=$(ip r | awk '/default/ {print $5}' | head -n 1) vtund_port="5000"
vtund_iface="tunnel" vtund_iface="tunnel"
device_name="IPC-VTUND" device_name="IPC-VTUND"
working_dir="/tmp" working_dir="/tmp"
identity() { identity() {
identity_mac=$(cat /sys/class/net/${vtund_source}/address | tr 'a-z' 'A-Z') identity_src=$(ip r | awk '/default/ {print $5}' | head -n 1)
identity_mac=$(cat /sys/class/net/${identity_src}/address | tr 'a-z' 'A-Z')
identity_pas=$(echo ${identity_mac} | sha1sum | awk '{print $1}') identity_pas=$(echo ${identity_mac} | sha1sum | awk '{print $1}')
identity_tid=$(echo ${identity_mac} | tr -d ':') identity_tid=$(echo ${identity_mac} | tr -d ':')
identity_cfg=${working_dir}/vtund.conf identity_cfg=${working_dir}/vtund.conf