diff --git a/backup_to_external.sh b/backup_to_external.sh index 285bd0d..076c1cb 100755 --- a/backup_to_external.sh +++ b/backup_to_external.sh @@ -1,6 +1,6 @@ #!/bin/bash -INTERFACE_PATH=/home/andreas/.virtualenvs/borg_interface -PATH=$PATH:$INTERFACE_PATH/bin/ -source $INTERFACE_PATH/bin/activate -python3 $INTERFACE_PATH/backup_to_external.py +SCRIPTPATH=$(dirname -- "$(readlink -e -- "$BASH_SOURCE")") +PATH=$PATH:$SCRIPTPATH/bin/ +source $SCRIPTPATH/bin/activate +python3 $SCRIPTPATH/backup_to_external.py exit 0 diff --git a/borg_interface.sh b/borg_interface.sh index a4a1068..c480096 100755 --- a/borg_interface.sh +++ b/borg_interface.sh @@ -1,5 +1,14 @@ #!/bin/bash -PATH=$PATH:borg_interface/bin/ -source borg_interface/bin/activate -python3 borg_interface/main.py + +# Get the current working directory +SCRIPTPATH=$(dirname -- "$(readlink -e -- "$BASH_SOURCE")") + +# add the bin directory to the path +PATH=$PATH:$SCRIPTPATH/borg_interface/bin/ + +# activate the virtual environment +source $SCRIPTPATH/borg_interface/bin/activate + +# execute the main script +python3 $SCRIPTPATH/borg_interface/main.py exit 0