shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Client GUI VPN Gate [shell/yad]


From: maik . alberto
Subject: Client GUI VPN Gate [shell/yad]
Date: 30 Aug 2017 12:14:08 +0000

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

source:

#!/bin/bash

#---------------------------------------#
#	Created by: Maik Alberto	#
#	address@hidden	#
#	    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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]