From: Mazet Laurent Date: Fri, 19 Sep 2025 12:19:07 +0000 (+0200) Subject: script working with vpn red on application board X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=08da25b6ade58730e2965a342e8fb7bf490eb24d;p=ulvpn.git script working with vpn red on application board --- diff --git a/ulvpn.sh b/ulvpn.sh index 993656a..fbe7aa3 100755 --- a/ulvpn.sh +++ b/ulvpn.sh @@ -1,10 +1,10 @@ -#!/bin/bash +#!/bin/sh MTU=1439 TEST=$(basename $0 .sh) PWD=$(dirname $0) -PWD=/opt/ulvpn/bin +#PWD=/opt/ulvpn/bin CRYPTOMOD=$PWD/cryptomod.exe SIMULATOR=$PWD/simulator.exe @@ -67,6 +67,8 @@ app) # only red vpn LRED=eth0://78:a1:35:10:10:10 RRED=eth0://78:a1:35:01:01:01 + RCRY=0809 + RPRO=080B DEVS=$LRED ;; soft) @@ -75,6 +77,8 @@ app) LBLK=eth0://78:a1:35:20:20:20 RRED=lo://00:00:00:00:00:00 RBLK=eth0://78:a1:35:02:02:02 + RCRY=0819 + RPRO=081B DEVS=$RBLK ;; none) @@ -126,7 +130,7 @@ for DEV in $DEVS; do ip link set dev ${DEV/:*} up ip addr add 192.169.$N.1/24 dev ${DEV/:*} sleep 1 - #tcpdump -v -i ${DEV/:*} & + #tcpdump -v -i ${DEV/:*} & pid=$!; pids="$pids $pid" done if [ "$CM" = soft ]; then @@ -135,13 +139,13 @@ if [ "$CM" = soft ]; then -s BYPASS_B2R -t $LRED/080D -r $LBLK/083D \ -s BYPASS_R2B -t $LBLK/082D -r $LRED/081D \ -s CONTROL -t $LRED/080E -r $LRED/081E \ - -s CROSS_CRYPTO_B2R -t $LRED/0809 -r $LBLK/0839 \ - -s CROSS_CRYPTO_R2B -t $LBLK/0829 -r $LRED/0819 \ + -s CROSS_CRYPTO_B2R -t $LRED/0809 -r $LBLK/0809 \ + -s CROSS_CRYPTO_R2B -t $LBLK/0809 -r $LRED/$RCRY \ -s PROVISIONING -t $LRED/080B -r $LRED/081B & pid=$! pids="$pids $pid" sleep 1 - ps | awk '$2 == '$pid' {exit 1}' && { fail KO; exit 1; } || pass OK + ps | awk '$1 == '$pid' || $2 == '$pid' {exit 1}' && { fail KO; exit 1; } || pass OK fi if [ "$VPNBLK" ]; then @@ -149,12 +153,12 @@ if [ "$VPNBLK" ]; then $VPN -v 1 -V 1 -l vpnblk.log \ -n tun \ $VPNBLK \ - -x $RBLK/0829 $RBLK/0839 \ + -x $RBLK/0809 $RBLK/0809 \ -n red & pid=$! pids="$pids $pid" sleep 1 - ps | awk '$2 == '$pid' {exit 1}' && { fail KO; exit 1; } || pass OK + ps | awk '$1 == '$pid' || $2 == '$pid' {exit 1}' && { fail KO; exit 1; } || pass OK fi if [ "$VPNRED" ]; then @@ -163,14 +167,16 @@ if [ "$VPNRED" ]; then $VPNRED \ -n udp \ -n black \ - -y $RRED/0809 $RRED/0819 & + -y $RRED/0809 $RRED/$RCRY & pid=$! pids="$pids $pid" sleep 1 - ps | awk '$2 == '$pid' {exit 1}' && { fail KO; exit 1; } || pass OK + # fix for Android + ip rule add from all lookup main + ps | awk '$1 == '$pid' || $2 == '$pid' {exit 1}' && { fail KO; exit 1; } || pass OK - launch provisioning software cryptomod - $SIMULATOR -v1 -V1 -s PROVISIONING -r $LRED/080B -t $LRED/081B provisioning.eth && pass OK || { fail KO; exit 1; } + launch provisioning $CM cryptomod + $SIMULATOR -v1 -V1 -s PROVISIONING -r $RRED/080B -t $RRED/$RPRO provisioning.eth && pass OK || { fail KO; exit 1; } fi title press any key to stop