commit 980bbfa597e05bacc770224ac52ed445628e3121 parent ee58a6739aeba0bbe73b4f8616b44de309992879 Author: Morel BĂ©renger <berenger.morel@neutralite.org> Date: Thu, 14 Nov 2019 17:06:53 +0100 Fixed runit/common * variables are now defined, not only defaulted use; * no longer logs common's stuff; * use absolute paths; Diffstat:
M | etc/runit/common | | | 16 | ++++++++-------- |
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/etc/runit/common b/etc/runit/common @@ -6,22 +6,22 @@ die() exit 1 } -HAS_LOG="$(test -d "$SVNAME/log" && printf "yes")" -test "yes" = "$HAS_LOG" && exec 2>&1 +SVNAME="$(basename $(pwd))" +HAS_LOG="$(test -d "$(pwd)/log" && printf "yes")" exec 0<&- set -x -SVNAME="$(basename $(pwd))" - -printf "Preparing %s launch...\n" $SVNAME test -f conf && . ./conf if test "$SVNAME" = "log" then SVLOG="$(basename $(dirname $(pwd)))" SVNAME="${SVLOG}/${SVNAME}" - AUTO_ROTATE=${AUTO_ROTATE:-"no"} + AUTO_ROTATE=${AUTO_ROTATE:="no"} fi -test "yes" = "${AUTO_ROTATE:-$HAS_LOG}" && +test "yes" = "${AUTO_ROTATE:=$HAS_LOG}" && test "yes" = "$HAS_LOG" && - sv alarm "$SVNAME/log" + sv alarm "$(pwd)/log" + +printf "Preparing %s launch...\n" $SVNAME +test "yes" = "$HAS_LOG" && exec 2>&1