summaryrefslogtreecommitdiff
path: root/bin/browse.sh
blob: 7d91caef88f17794b00436a148e346903a80a17c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh

TAB_HOST="localhost"
TAB_PORT=${TAB_PORT:-1424}

if [ -f /proc/1/cgroup ]; then
    if grep -q docker /proc/1/cgroup; then
        TAB_HOST=$(ip route | awk '/default/ { print $3 }')
    fi
fi

curl --max-time 5 --connect-timeout 3 -F"a=$(echo $1 | sed s/\"/%22/g)" http://${TAB_HOST}:${TAB_PORT}