Skip to content
This repository was archived by the owner on Mar 16, 2024. It is now read-only.

Commit 6a1ad61

Browse files
committed
Merge branch 'jakopako/master'
2 parents 436e745 + 0dec9be commit 6a1ad61

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

data/scripts/tinyproxy_wrapper.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
echo -e "Running Tinyproxy HTTP proxy server.\n"
4+
5+
until ip link show tun0 2>&1 | grep -qv "does not exist"; do
6+
sleep 1
7+
done
8+
9+
get_addr() {
10+
ip address show "$1" | grep 'inet ' | awk '{split($2, inet, "/"); print inet[1]}'
11+
}
12+
13+
addr_eth=${LISTEN_ON:-$(get_addr eth0)}
14+
addr_tun=$(get_addr tun0)
15+
sed -i \
16+
-e "/Listen/c Listen $addr_eth" \
17+
-e "/Bind/c Bind $addr_tun" \
18+
/data/tinyproxy.conf
19+
20+
tinyproxy -d -c /data/tinyproxy.conf

0 commit comments

Comments
 (0)