Minor bash formatting changes

This commit is contained in:
Jose Diaz-Gonzalez
2014-11-23 16:42:21 -05:00
parent e7219c0346
commit 8bc3d372ec
3 changed files with 12 additions and 11 deletions

View File

@@ -8,13 +8,13 @@ case "$1" in
logs) logs)
if [[ -z $2 ]]; then if [[ -z $2 ]]; then
echo "Please specify an app to run the command on" echo "Please specify an app to run the command on"
exit 1 exit 1
fi fi
APP="$2"; APP="$2";
if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then if [[ ! -d "$DOKKU_ROOT/$APP" ]]; then
echo "App $APP does not exist" echo "App $APP does not exist"
exit 1 exit 1
fi fi
if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]]; then if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]]; then
@@ -55,7 +55,7 @@ case "$1" in
if [[ -f "$DOKKU_ROOT/$APP/URL" ]]; then if [[ -f "$DOKKU_ROOT/$APP/URL" ]]; then
echo $(< "$DOKKU_ROOT/$APP/URL") echo $(< "$DOKKU_ROOT/$APP/URL")
fi fi
;; ;;
version) version)
cat "$DOKKU_ROOT/VERSION" || { cat "$DOKKU_ROOT/VERSION" || {

View File

@@ -94,7 +94,7 @@ case "$1" in
echo "=== $APP config vars ===" echo "=== $APP config vars ==="
config_styled_hash "$VARS" config_styled_hash "$VARS"
;; ;;
config:get) config:get)
if [[ -z $3 ]]; then if [[ -z $3 ]]; then
@@ -110,7 +110,7 @@ case "$1" in
KEY="$3" KEY="$3"
cat $ENV_FILE | grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" | grep "^export $KEY=" | cut -d"=" -f2- | sed -e "s/^'//" -e "s/'$//" cat $ENV_FILE | grep -Eo "export ([a-zA-Z_][a-zA-Z0-9_]*=.*)" | grep "^export $KEY=" | cut -d"=" -f2- | sed -e "s/^'//" -e "s/'$//"
;; ;;
config:set) config:set)
if [[ -z "${*:3}" ]]; then if [[ -z "${*:3}" ]]; then
@@ -154,7 +154,7 @@ ${var}"
config_write "$ENV_TEMP" config_write "$ENV_TEMP"
fi fi
;; ;;
config:unset) config:unset)
if [[ -z $3 ]]; then if [[ -z $3 ]]; then
@@ -173,7 +173,7 @@ ${var}"
config_write "$ENV_TEMP" config_write "$ENV_TEMP"
done done
;; ;;
help | config:help) help | config:help)
cat && cat<<EOF cat && cat<<EOF
@@ -182,6 +182,6 @@ ${var}"
config:set <app> KEY1=VALUE1 [KEY2=VALUE2 ...] Set one or more config vars config:set <app> KEY1=VALUE1 [KEY2=VALUE2 ...] Set one or more config vars
config:unset <app> KEY1 [KEY2 ...] Unset one or more config vars config:unset <app> KEY1 [KEY2 ...] Unset one or more config vars
EOF EOF
;; ;;
esac esac

View File

@@ -34,8 +34,9 @@ case "$1" in
mv "$TEMP_DIR/server.key" "$DOKKU_ROOT/$APP/tls/server.key" mv "$TEMP_DIR/server.key" "$DOKKU_ROOT/$APP/tls/server.key"
rm -rf $TEMP_DIR rm -rf $TEMP_DIR
;; ;;
help | nginx:help) help | nginx:help)
cat && cat<<EOF cat && cat<<EOF
nginx:import-ssl <app> Imports a tarball from stdin; should contain server.crt and server.key nginx:import-ssl <app> Imports a tarball from stdin; should contain server.crt and server.key
EOF EOF
;; ;;