Hello all,
I connect to my school's vpn with openconnect (which requires root), then connect to the shares from konqueror (smb://...), which does not.
I've tried to automate this a little with a bash script.
It first runs tdesu <openconnect_script>, then konqueror smb://...
My problem is that I need to run:
tdesu <openconnect_script> &
Then, I need to wait for that script to succeed before connecting to the shares. I can't use wait{!} because the script does not terminate.
My current solution is sleep, which globaly works. I've noticed that if I connect from a konsole I get a notification (new network tun0 found). I wondered if I could read some event linked to that notification to start the konqueror connect script.
Any idea?
Thierry
Am Sonntag, 28. Januar 2018 schrieb Thierry de Coulon:
Hello all,
I connect to my school's vpn with openconnect (which requires root), then connect to the shares from konqueror (smb://...), which does not.
I've tried to automate this a little with a bash script.
It first runs tdesu <openconnect_script>, then konqueror smb://...
My problem is that I need to run:
tdesu <openconnect_script> &
Then, I need to wait for that script to succeed before connecting to the shares. I can't use wait{!} because the script does not terminate.
My current solution is sleep, which globaly works. I've noticed that if I connect from a konsole I get a notification (new network tun0 found). I wondered if I could read some event linked to that notification to start the konqueror connect script.
Any idea?
well, you could poll for tun0, till it appears:
tdesu <openconnect_script> & while sleep 1; do xmessage "waiting for tun0" -timeout 1 & ip addr show dev tun0 1>/dev/null 2>&1 && break; done
Nik
On Monday 29 January 2018 09.01:51 Dr. Nikolaus Klepp wrote:
well, you could poll for tun0, till it appears:
tdesu <openconnect_script> & while sleep 1; do xmessage "waiting for tun0" -timeout 1 & ip addr show dev tun0 1>/dev/null 2>&1 && break; done
Nik
Thank you Nik. xmessage steals focus from tdesu and I can't input the password, so I removed that.
Now I run:
tdesu <openconnect_script> & while sleep 1; do ip addr show dev tun0 1>/dev/null 2>&1 && break; done
and I put a zenity call in <openconnect_script>
That works quite well.
Regards,
Thierry