summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Oberkirch2015-03-07 21:58:28 +1300
committerMilan Oberkirch2015-03-07 21:58:28 +1300
commit37c053390b07380f3cea44e0ac876168c389ea9a (patch)
tree70800e6be516cd1fda16ee7385b299c5e627c395
parente960fe6a9bf3dbf060cf2cb26d113a73d2b7fbb7 (diff)
downloadaur-37c053390b07380f3cea44e0ac876168c389ea9a.tar.gz
some error handling
-rwxr-xr-xzenbu-login.bash3
1 files changed, 3 insertions, 0 deletions
diff --git a/zenbu-login.bash b/zenbu-login.bash
index b62a6494a332..d3ac2e03f770 100755
--- a/zenbu-login.bash
+++ b/zenbu-login.bash
@@ -4,6 +4,9 @@ __NAME__="zenbu-login"
# the following file should define 2 variables: $username and $password:
source /etc/"${__NAME__}"
+if [[ "$username" == "" ]]; then
+ echo You need to define username and password in /etc/${__NAME__}.
+ exit 1
function zenbu-login () {
post_data="form_request=login&gw_address=10.10.24.1&gw_port=2060&gw_id=ZenBu10289&mac=EC%3A0E%3AC4%3A1C%3A8E%3A2F&auth_source=default-network&username=$username&password=$password&form_submit=login"