about summary refs log tree commit diff
path: root/functions
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2016-08-24T14·01-0400
committerWilliam Carroll <wpcarro@gmail.com>2016-08-24T14·01-0400
commit73a836b1dd48821dba24a44ae371e60bee3b40a3 (patch)
tree5365ff56e7382a722821c9bd78c78cb026f24761 /functions
parent63b282709308bf04b58ffbccd6849254eed3133d (diff)
parentc836c5508134cee1aa004a83784ccef162c9603c (diff)
Merge branch 'master' of https://github.com/wpcarro/pc_settings
Diffstat (limited to 'functions')
-rw-r--r--functions/index.sh17
1 files changed, 15 insertions, 2 deletions
diff --git a/functions/index.sh b/functions/index.sh
index a60bc4167ce9..ae73bed38f54 100644
--- a/functions/index.sh
+++ b/functions/index.sh
@@ -1,4 +1,4 @@
-functon npms() {
+npms() {
   clear;
   npm start;
 }
@@ -19,7 +19,6 @@ source $HOME/pc_settings/functions/history_functions.sh
 # custom functions to work with vim
 source $HOME/pc_settings/functions/vim_functions.sh
 
-
 # generates placeholder content for FE work
 function lorem {
     text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
@@ -37,3 +36,17 @@ function wsearchpath {
   echo $PATH | tr ':' '\n' | xargs -I {} find {} -type f -perm +111 -maxdepth 1 -name "*${1}*" -print | xargs basename
 }
 
+
+# tests an internet connection
+function is_online {
+  wget -q --spider "http://google.com"
+
+  if [ $? -eq 0 ]; then
+    echo "Online"
+    return 0
+  else
+    echo "Offline"
+    return 1
+  fi
+}
+