diff options
author | Victor Toso <victortoso@redhat.com> | 2016-02-12 17:08:08 +0100 |
---|---|---|
committer | Victor Toso <victortoso@redhat.com> | 2016-02-12 17:08:08 +0100 |
commit | 8a3aee58934dfdea2948e529ca137579b9cc1935 (patch) | |
tree | f8163bd2e9c4f36a637505fa8dede93938226fd9 |
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-x | toso-utils.sh | 21 |
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 +} |