Skip to content

Check for idle connections and reconnect when failed.

Notifications You must be signed in to change notification settings

davodego/connection_check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

connection_check

Check for idle connections and reconnect when failed. For use with "systemd" "units". A timer unit checks every 5 minutes whether there is a connection via a specific port (ESTABLISHED). If the connection is missing, a system service is started to re-establish the connection.

Possible use:

  • Mail agent (fetchmail, getmail) loses connection to the IMAP IDLE account, e.g. because of a forced disconnection by the DSL provider.

  • IMAP IDLE connection to a server is not stable and breaks off, e.g. due to a network change WiFi> Mobile data> WiFi (sailfish OS).

Installation:

  1. Copy connection-check.sh to the location of your choice.
  2. Open the file connection-check.sh Change PORT with the number of the port you want to check. Change line 14 and add the command or systemd service you want to restart and save it.
  3. Copy connection-check.timer to /etc/systemd/system/
  4. Copy connection-check.service to /etc/systemd/system/
  5. Open connection-check.service. Change the path in service file to where connection-check.sh is and save it.
  6. Restart the systemd daemon with:
systemctl daemon-reload
  1. Start the timer:
systemctl start connection-check.timer
  1. To start the timer at boot do:
systemctl enable connection-check.timer

About

Check for idle connections and reconnect when failed.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages