maik.alberto@hotmail.com [shell-script]
2017-08-30 12:14:08 UTC
Bom dia Senhores!
Enfim dei uma olhada no yad pra aprender um pouco, criei com shell e yad um client para o VPN GATE, nessa caminhada consultei materiais do Raimundo Alves Portela e Júlio Cezar Neves entre outros da gringa. A caminhada não para.Compartilhando...
https://github.com/m41k/clivgate https://github.com/m41k/clivgate
source:
#!/bin/bash
#---------------------------------------#
# Created by: Maik Alberto #
# ***@hotmail.com #
# github.com/m41k #
#---------------------------------------#
on(){
rm -f /tmp/servers 2> /dev/null
wget www.vpngate.net/api/iphone/ -O /tmp/servers 2>&1 |
yad --progress \
--title="CliVGate" \
--width=200 \
--window-icon='network-vpn' \
--image='edit-find-symbolic' \
--text="<b>Loading server list...</b>" \
--progress-text="wait please" \
--no-buttons \
--pulsate \
--auto-close \
--auto-kill
LISTA=( `tail -n +3 /tmp/servers | cut -s -d "," -f2,7 | while read LINHA; do echo "$LINHA"; done `)
SEASE=$(yad --entry --width=200 --title="CliVGATE" \
--window-icon='network-vpn' \
--text="<b>Select a server:</b>" \
--entry-text \
${LISTA[@]} \
--button="Connect" )
SERVER=( `echo $SEASE | cut -d"," -f1` )
cat /tmp/servers | grep $SERVER | cut -d"," -f15 | base64 -d > /tmp/cfov 2> /dev/null
openvpn --config /tmp/cfov &
tray
}
off(){
yad --width=200 --title="CliVGATE" \
--window-icon='network-vpn' \
--text-align='center' \
--text="<small>Created by: github.com/m41k</small>" \
--buttons-layout='center' \
--button="Disconnect"
if [ $? -eq 0 ]; then
killall openvpn &
fi
}
tray(){
yad --width=200 --notification \
--image='network-vpn' \
--text "CliVGATE"
off
}
ifconfig | grep tun
if [ $? -eq 0 ]; then
off
fi
case $1 in
off)off
;;
tray)tray
;;
on)on
;;
esac
Enfim dei uma olhada no yad pra aprender um pouco, criei com shell e yad um client para o VPN GATE, nessa caminhada consultei materiais do Raimundo Alves Portela e Júlio Cezar Neves entre outros da gringa. A caminhada não para.Compartilhando...
https://github.com/m41k/clivgate https://github.com/m41k/clivgate
source:
#!/bin/bash
#---------------------------------------#
# Created by: Maik Alberto #
# ***@hotmail.com #
# github.com/m41k #
#---------------------------------------#
on(){
rm -f /tmp/servers 2> /dev/null
wget www.vpngate.net/api/iphone/ -O /tmp/servers 2>&1 |
yad --progress \
--title="CliVGate" \
--width=200 \
--window-icon='network-vpn' \
--image='edit-find-symbolic' \
--text="<b>Loading server list...</b>" \
--progress-text="wait please" \
--no-buttons \
--pulsate \
--auto-close \
--auto-kill
LISTA=( `tail -n +3 /tmp/servers | cut -s -d "," -f2,7 | while read LINHA; do echo "$LINHA"; done `)
SEASE=$(yad --entry --width=200 --title="CliVGATE" \
--window-icon='network-vpn' \
--text="<b>Select a server:</b>" \
--entry-text \
${LISTA[@]} \
--button="Connect" )
SERVER=( `echo $SEASE | cut -d"," -f1` )
cat /tmp/servers | grep $SERVER | cut -d"," -f15 | base64 -d > /tmp/cfov 2> /dev/null
openvpn --config /tmp/cfov &
tray
}
off(){
yad --width=200 --title="CliVGATE" \
--window-icon='network-vpn' \
--text-align='center' \
--text="<small>Created by: github.com/m41k</small>" \
--buttons-layout='center' \
--button="Disconnect"
if [ $? -eq 0 ]; then
killall openvpn &
fi
}
tray(){
yad --width=200 --notification \
--image='network-vpn' \
--text "CliVGATE"
off
}
ifconfig | grep tun
if [ $? -eq 0 ]; then
off
fi
case $1 in
off)off
;;
tray)tray
;;
on)on
;;
esac