From e137cdb813c571d338a61d7c6b9ed2b5f8e16d3c Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Mon, 17 Aug 2020 19:29:27 +0200 Subject: [PATCH] improved uni vpn script --- .config/qutebrowser/qsettings/QtProject.conf | 4 ++-- .local/bin/tools/ethvpn | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.config/qutebrowser/qsettings/QtProject.conf b/.config/qutebrowser/qsettings/QtProject.conf index 3b04c2b..ac7cc56 100644 --- a/.config/qutebrowser/qsettings/QtProject.conf +++ b/.config/qutebrowser/qsettings/QtProject.conf @@ -1,6 +1,6 @@ [FileDialog] -history=file:///home/alex, file:///home/alex/eth/thermo2, file:///home/alex/eth/wuf2, file:///home/alex/eth/innoproz, file:///home/alex/bks/Magazines/Death to the World -lastVisited=file:///home/alex/bks/Magazines/Death to the World +history=file:///home/alex, file:///home/alex/eth/thermo2, file:///home/alex/eth/wuf2, file:///home/alex/eth/innoproz, file:///home/alex/bks/Magazines/Death to the World, file:///home/alex/eth/fluid1 +lastVisited=file:///home/alex/eth/fluid1 qtVersion=5.15.0 shortcuts=file:, file:///home/alex sidebarWidth=82 diff --git a/.local/bin/tools/ethvpn b/.local/bin/tools/ethvpn index e2dcec4..530dcf6 100755 --- a/.local/bin/tools/ethvpn +++ b/.local/bin/tools/ethvpn @@ -1,2 +1,12 @@ -#!/bin/bash -[ $( pgrep -c openconnect ) -eq 0 ] &&( dmenupass "Password for ETH-VPN:" | sudo openconnect -g student-net -u abocken@student-net.ethz.ch --passwd-on-stdin sslvpn.ethz.ch ) || ( sudo pkill openconnect; notify-send "ETH VPN" "ETH VPN disconnected") +#!/bin/sh +user="abocken@student-net.ethz.ch" +password_path="ETH/VPN" +if [ $(pgrep -c openconnect) -eq 0 ]; then + pass "$password_path" | sudo openconnect -g student-net -u "$user" --passwd-on-stdin sslvpn.ethz.ch & + sleep 4 + if [ $(pgrep -c openconnect) -eq 1 ]; then + notify-send "ETH VPN" "ETH VPN connected" #implement an actual check here + fi +else + sudo pkill openconnect && notify-send "ETH VPN" "ETH VPN disconnected" +fi