Re: [dev] [ii] Reconnect

From: Evan Gates <evan.gates_AT_gmail.com>
Date: Thu, 13 Oct 2016 10:26:14 -0700

On Thu, Oct 13, 2016 at 7:47 AM, Thomas Levine <__AT_thomaslevine.com> wrote:
> I start ii and chat for a while. Then I lose my internet connection
> for a few hours. What is a good way to have ii automatically connect
> when I get my internet connection back?
>
> I guess I have determine whether ii has disconnected and whether I now
> have an internet connection. I don't know how to determine whether ii
> has disconnected.
>
> Thanks
>

I defined EXIT_TIMEOUT as 2, then after print_out(NULL, "-!- ii
shutting down: ping timeout"); I changed exit(EXIT_FAILURE) to
exit(EXIT_TIMEOUT). I run ii in a shell loop

while ii -n emg; [ "$?" -eq 2]; do :; done

Every time ii exits with status 2 it restarts.

-emg
Received on Thu Oct 13 2016 - 19:26:14 CEST

This archive was generated by hypermail 2.3.0 : Thu Oct 13 2016 - 19:36:11 CEST