Skip to content

A shell script which beeps like a pulse oximeter if a given http url returns a successful status-code. Useful if you need to wait for a certain service to be available again to continue a certain task and don't want to constantly hit F5 in your browser.

Notifications You must be signed in to change notification settings

IljaN/http_pulse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

http_pulse.sh

A shell script which beeps like a pulse oximeter if a given http url returns a successful status-code. Useful if you need to wait for a certain service to be available to continue a certain task and don't want to constantly hit F5 in your browser.

Usage

./http_pulse.sh --help
Check url for reachability via HTTP response code and beep when it is reachable

Usage: ./http_pulse.sh URL [check_interval_secs] [status-range]

Arguments:
  URL                    The url to check (required).
  check-interval-secs    Optional. The interval in seconds between checks (default: 30).
  status-range           Optional. The range of HTTP status codes to consider successful (default: 200-299).

Examples:
  ./http_pulse.sh https://www.github.com 3 200-201
  ./http_pulse.sh somelocalhost:8080

Example Output

$ ./http_pulse.sh https://www.github.com 3 200-201
[2024-12-31 19:47:39+01:00] Checking https://www.github.com every 3 seconds and beep as soon as the HTTP response code is in range of 200-201:
[2024-12-31 19:47:39+01:00] https://www.github.com is reachable with HTTP status code 200.
[2024-12-31 19:47:42+01:00] https://www.github.com is reachable with HTTP status code 200.
[2024-12-31 19:47:46+01:00] https://www.github.com is reachable with HTTP status code 200.
[2024-12-31 19:47:49+01:00] https://www.github.com is reachable with HTTP status code 200.

Requirements

  • curl and ffmpeg (ffplay) needs to be installed on your system.

About

A shell script which beeps like a pulse oximeter if a given http url returns a successful status-code. Useful if you need to wait for a certain service to be available again to continue a certain task and don't want to constantly hit F5 in your browser.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages