Re: reading notifications?

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

 



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 ...

---------------------------------------------------------------------
To unsubscribe, e-mail: trinity-users-unsubscribe@xxxxxxxxxxxxxxxxxxxxxxxxxx
For additional commands, e-mail: trinity-users-help@xxxxxxxxxxxxxxxxxxxxxxxxxx
Read list messages on the web archive: http://trinity-users.pearsoncomputing.net/
Please remember not to top-post: http://trinity.pearsoncomputing.net/mailing_lists/#top-posting




[Index of Archives]     [Trinity Devel]     [KDE]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]     [Trinity Desktop Environment]

  Powered by Linux