use HOME variable
This commit is contained in:
parent
d8e62a632d
commit
f049e72130
4 changed files with 12 additions and 10 deletions
|
@ -5,13 +5,13 @@
|
|||
# Parameters
|
||||
# --- $1 = Time schedule ('hourly' | 'daily' | 'weekly' | 'monthly')
|
||||
|
||||
USER=thomas
|
||||
export XDG_RUNTIME_DIR=/run/user/1000
|
||||
source /home/thomas/.env
|
||||
#USER=thomas
|
||||
#export XDG_RUNTIME_DIR=/run/user/1000
|
||||
#source /home/thomas/.env
|
||||
|
||||
SCHEDULE=$1
|
||||
THIS_FILE=${0}
|
||||
SLACK_NOTIFIER="/home/thomas/repos/utilities/slack_notifier.sh"
|
||||
SLACK_NOTIFIER="${HOME}/repos/utilities/slack_notifier.sh"
|
||||
|
||||
if mountpoint -q /media/samsung-T3; then
|
||||
ERROR=$(sudo /usr/bin/rsnapshot -c /etc/rsnapshot.conf hourly 2>&1)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
THIS_FILE=${0}
|
||||
SLACK_NOTIFIER="/home/thomas/repos/utilities/slack_notifier.sh"
|
||||
SLACK_NOTIFIER="${HOME}/repos/utilities/slack_notifier.sh"
|
||||
FILE_NAME=$(date +%Y-%m-%d_%H:%M:%S-%Z)
|
||||
BAK=$(ls -dt "/media/crucial/music/"*"music_lib_bak"* | head -n 1)
|
||||
TEMP="/media/crucial/music/temp"
|
||||
|
|
|
@ -4,11 +4,13 @@ BLUE='\033[0;34m'
|
|||
NO_COLOR='\033[0m'
|
||||
|
||||
echo -e "${BLUE}INFO Syncing music library to DAP SD card...${NO_COLOR}"
|
||||
/home/thomas/repos/utilities/music_sync/transfer_to_DAP.sh
|
||||
"${HOME}/repos/utilities/music_sync/transfer_to_DAP.sh"
|
||||
|
||||
sleep 3
|
||||
|
||||
echo -e "${BLUE}INFO Backing up music library to additional external drive...${NO_COLOR}"
|
||||
/home/thomas/repos/utilities/music_sync/backup_music_library.sh
|
||||
"${HOME}/repos/utilities/music_sync/backup_music_library.sh"
|
||||
|
||||
# /home/thomas/repos/utilities/music_sync/backup_music_library.sh
|
||||
|
||||
echo -e "${BLUE}INFO Backup completed...${NO_COLOR}"
|
||||
|
|
|
@ -63,7 +63,7 @@ ERROR_BLOCKS=$(
|
|||
)
|
||||
|
||||
# Initialise sound playback
|
||||
mpv --volume=0 --start=0 --length=0.1 /home/thomas/dotfiles/gruvbox-95/sounds/st-computer-on.mp3
|
||||
mpv --volume=0 --start=0 --length=0.1 "${HOME}/dotfiles/gruvbox-95/sounds/st-computer-on.mp3"
|
||||
sleep 1
|
||||
|
||||
# Process notification
|
||||
|
@ -72,11 +72,11 @@ if [ "$2" != "error" ]; then
|
|||
-H 'Content-type: application/json' \
|
||||
--data '{"text":"🟢 '"$3"'"}' \
|
||||
"$WEBHOOK"
|
||||
mpv --volume=100 /home/thomas/dotfiles/sounds/star-trek-computer-success.mp3
|
||||
mpv --volume=100 "${HOME}/dotfiles/sounds/star-trek-computer-success.mp3"
|
||||
else
|
||||
curl -X POST \
|
||||
-H 'Content-type: application/json' \
|
||||
--json "$ERROR_BLOCKS" \
|
||||
"$WEBHOOK"
|
||||
mpv --volume=100 /home/thomas/dotfiles/sounds/star-trek-computer-error.mp3
|
||||
mpv --volume=100 "${HOME}/dotfiles/sounds/star-trek-computer-error.mp3"
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue