| 12345678910111213141516171819202122232425262728293031323334 | #!/bin/bash#Define cleanupcleanup() {    nets=($(wg show interfaces))    for net in ${nets[@]}; do        echo "deleting interface" $net        ip link del $net    done}#Trap SigTermtrap 'cleanup' SIGTERMecho "[netclient] joining network"if [ -z "${SLEEP}" ]; then    SLEEP=10fiTOKEN_CMD=""if [ "$TOKEN" != "" ]; then    TOKEN_CMD="-t $TOKEN"fi/root/netclient join $TOKEN_CMD -udpholepunch noif [ $? -ne 0 ]; then { echo "Failed to join, quitting." ; exit 1; } fiecho "[netclient] Starting netclient daemon"/root/netclient daemon &wait $!echo "[netclient] exiting"
 |