Skip to content

CLI tool that will continuously ping a target ip / host and if no longer responding, will reboot the host machine

Notifications You must be signed in to change notification settings

dabump/pingreboot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ping Reboot

build workflow build workflow

TL;DR

CLI tool that will ping a target until connectiviy issue, and will restart the local machine

Background

My Linux server in the garage on occasion loses network connectivity to the router.

Even though the machine is hardwired to the router via ethernet cable, it stops responding to ICMP and SSH requests.

This little utility will ping a target host or IP until the remote host no longer responds. After a number of retry attempts, the reboot instruction will be sent to the underlying OS.

Prerequisites

In order to build this library, you will need to have GIT and GO installed. In addition the machine needs to have access to the internet in order to download the additional libraries.

How to use

  1. Clone the repository.
  2. Execute make build - this will build the pingreboot binary for the machine OS and architecture type
  3. cd bin and run the tool ./pingreboot and provide the required flags

The command line

# Specify the target
pingreboot --target 1.1.1.1 

# Add interval in minutes between pings to target (default: 1 minute)
pingreboot --target 1.1.1.1 --interval 2

# Specify the failure retry count before restart (default: 3 retries)
pingreboot --target 1.1.1.1 --retry-count 5

About

CLI tool that will continuously ping a target ip / host and if no longer responding, will reboot the host machine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published