summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Toso <victortoso@redhat.com>2016-02-12 17:08:08 +0100
committerVictor Toso <victortoso@redhat.com>2016-02-12 17:08:08 +0100
commit8a3aee58934dfdea2948e529ca137579b9cc1935 (patch)
treef8163bd2e9c4f36a637505fa8dede93938226fd9
utils: small set of functions for scripts
on_redhat_vpn: just checks if it can download an internal file. on_redhat_vpn_test: for easy testing on cmd line
-rwxr-xr-xtoso-utils.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/toso-utils.sh b/toso-utils.sh
new file mode 100755
index 0000000..abd89d6
--- /dev/null
+++ b/toso-utils.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+bashtrue=0
+bashfalse=1
+
+function on_redhat_vpn()
+{
+ url="http://password.corp.redhat.com/newca.crt"
+ curl -s --max-time 5 $url > /dev/null
+ return $?
+}
+
+function on_redhat_vpn_test()
+{
+ if on_redhat_vpn;
+ then
+ echo "on Red Hat VPN";
+ else
+ echo "not on Red Hat VPN";
+ fi
+}