Commit 08368e21 authored by Michael Iseard's avatar Michael Iseard
Browse files

Add line to set working directory to script location

parent 63734cf7
#!/bin/bash
cd "$(dirname "$0")"
# VARIABLES
......@@ -17,8 +18,8 @@ exec > >( tee >( sed 's/\x1B\[[0-9;]*[JKmsu]//g' >> $name.log ) )
# LOAD ENVS
if [ -f ".env" ]; then
export $(egrep -v '^#' .env | xargs) > /dev/null
if [ -f "./.env" ]; then
export $(egrep -v '^#' ./.env | xargs) > /dev/null
else
echo $error ".env file not found"
exit 1
......@@ -40,7 +41,7 @@ function check_result() {
if [[ ! -z "$IM_NFS_MOUNT_POINT" || "$IM_NFS_SOURCE" ]]; then
echo -n 'Mounting NFS.......'$dots
sudo mount $IM_NFS_SOURCE $IM_BACKUP_DESTINATION
mount $IM_NFS_SOURCE $IM_BACKUP_DESTINATION
check_result 1
fi
......@@ -68,4 +69,4 @@ if [ ! -z "$containers" ]; then
echo -n 'Starting containers'$dots
docker start $containers > /dev/null 2>&1
check_result 1
fi
\ No newline at end of file
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment