aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-02-20 14:24:15 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-02-20 14:24:15 -0300
commitd55a580084c7130eb3a454ec3be4f51d6e659345 (patch)
tree9b07c4d52f7c7dad4a34c315b76cacc0f183eedf /lib
parent5a7539b7d4ebdf4a43e0125ada58f65595ea20a6 (diff)
downloadhydra-d55a580084c7130eb3a454ec3be4f51d6e659345.tar.gz
hydra-d55a580084c7130eb3a454ec3be4f51d6e659345.tar.bz2
Fixes hydra_set_env for init and register actions
Diffstat (limited to 'lib')
-rw-r--r--lib/hydra/misc15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/hydra/misc b/lib/hydra/misc
index 89e0aa0..a3156a7 100644
--- a/lib/hydra/misc
+++ b/lib/hydra/misc
@@ -6,7 +6,10 @@ function hydra_set_env {
export OSVERSION="`cut -d . -f 1 /etc/debian_version`"
export COMMIT="`( cd $APP_BASE && git log -n 1 --pretty=oneline 2> /dev/null | cut -d " " -f 1 )`"
export CONFIG="$HOME/.hydra/config"
- export ACTION="$1"
+
+ if [ -z "$ACTION" ]; then
+ export ACTION="$1"
+ fi
if [ "`whoami`" != 'root' ]; then
SUDO="sudo"
@@ -17,10 +20,12 @@ function hydra_set_env {
export PREFERENCES="$HOME/.hydra/$HYDRA"
fi
- if [ "$NAME" == "hydra" ] && [ "$ACTION" != "register" ] && [ "$ACTION" != "init" ]; then
- if [ -z "$HYDRA_FOLDER" ] || [ ! -d "$HYDRA_FOLDER" ]; then
- echo "hydra $HYDRA not configured, aborting"
- exit 1
+ if [ "$NAME" == "hydra" ]; then
+ if [ "$ACTION" != "register" ] && [ "$ACTION" != "init" ]; then
+ if [ -z "$HYDRA_FOLDER" ] || [ ! -d "$HYDRA_FOLDER" ]; then
+ echo "hydra $HYDRA not configured, aborting"
+ exit 1
+ fi
fi
fi
}