more robust references to script directory

This commit is contained in:
2024-03-22 07:12:18 +01:00
parent 7de4aa3e8e
commit 71539fb906
2 changed files with 7 additions and 3 deletions

View File

@@ -1,6 +1,8 @@
#!/bin/bash
. /home/spezi/Scripts/utils/colors.sh
# https://stackoverflow.com/a/246128
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
. $SCRIPT_DIR/colors.sh
logger () {
echo -e "${NC}$(date) - [$BASHPID] - [${0##*/}] - $@${NC}"

View File

@@ -1,6 +1,8 @@
#!/bin/bash
DIRECTORY=$(cd `dirname $0` && pwd)
. /home/spezi/Scripts/utils/utils.sh
# https://stackoverflow.com/a/246128
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
. $SCRIPT_DIR/utils.sh
# https://unix.stackexchange.com/questions/66766/float-operation-with-bc
# https://unix.stackexchange.com/questions/89712/how-to-convert-floating-point-number-to-integer