commit f420de638537fffb66c885e85a8d5f39d5fabff7
parent 1e49cd6ae8825d7d0742a4b0200d061c7c39b9a5
Author: jacob@thinkpad <jacobouno@protonmail.com>
Date: Fri, 28 Feb 2020 21:10:57 -0800
Merge branch 'master' of https://github.com/jacobs-github/.dotfiles
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/aliases/.aliases b/aliases/.aliases
@@ -47,6 +47,13 @@ alias l="$PAGER"
function dict(){
curl "dict.org/d:$1" | less
}
+is_up(){
+ if [ "$( ping -c 1 -W 1.2 "$1" | tail -n 2 | head -n 1 | cut -d ',' -f 2 | awk '{print $1}' )" -ne 0 ]; then
+ printf "$1 is up.\n"
+ else
+ printf "$1 is down.\n"
+ fi
+}
# for opening the note of today (through my note script in bin repo)
function daily(){