summaryrefslogtreecommitdiff
path: root/probe-hdmi/init.sh
diff options
context:
space:
mode:
Diffstat (limited to 'probe-hdmi/init.sh')
-rwxr-xr-xprobe-hdmi/init.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/probe-hdmi/init.sh b/probe-hdmi/init.sh
new file mode 100755
index 0000000..c5e6097
--- /dev/null
+++ b/probe-hdmi/init.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+export supertitle="Probe HDMI"
+source easybashgui
+
+INET_AVAILABLE=0
+DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+
+# =====================================================================================
+# Functions in order they get called #
+# =====================================================================================
+
+function check_internet() {
+ wait_seconds 2
+ wget -P $DIR http://google.com/robots.txt &> /dev/null
+ return_code=$?
+ [ $return_code -eq 0 ] && INET_AVAILABLE=1
+ rm $DIR/robots.txt
+}
+
+# ======================================================================================
+
+function pull_updates() {
+ # If internet available just merge the changes
+ [ $INET_AVAILABLE -eq 1 ] && cd $DIR && git pull>/dev/null 2>&1
+}
+
+check_internet
+pull_updates
+bash $DIR/probe-hdmi.sh&