trinity-users@lists.pearsoncomputing.net

Message: previous - next
Month: January 2018

Re: [trinity-users] reading notifications?

From: "Dr. Nikolaus Klepp" <office@...>
Date: Mon, 29 Jan 2018 09:01:51 +0100
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

-- 
Please do not email me anything that you are not comfortable also sharing with the NSA, CIA ...