Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- lofplay=52.0.0.0
- fonction appconect
- {
- [[ $(which cedora) ]] && app=cedora
- [[ $(which crossover) ]] && app=crossover
- [[ $(which wine) ]] && app=wine
- [[ -z $app ]] && echo "no interpretator was found, you can try apt-get install wine to get on"
- #$app ./lof_play.exe
- echo "$app"
- }
- cd $(dirname "${0}")
- ipserv=$(egrep -o "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" ./data/clientinfo.xml | sed -n '1p' )
- port=$(egrep -o "[0-9]{4,5}" ./data/clientinfo.xml | sed -n '1p' )
- echo "$ipserv and $port"
- appconect()
- iptry=$(netstat -nta | awk '{print $5}' | grep -o $port && "[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*")
- [[ -z $iptry ]] && iptry=$lofplay
- sudo iptables -t nat -A OUTPUT -d $iptry -j DNAT --to $ipserv
- echo "$iptry"
- appconect()
- sudo iptables -t nat -D OUTPUT -d $iptry -j DNAT --to $ipserv
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement