Skip to content

Commit 01a38db

Browse files
committed
Fix evcc backup script
1 parent 38bd2d5 commit 01a38db

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

files/backup/evcc_container_backup.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,26 @@ restore() {
118118

119119
log_message "Restore successful" low
120120
}
121+
122+
# Check if the script is being run as a standalone script
123+
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
124+
# Check the first argument to determine the action
125+
case "$1" in
126+
before)
127+
before
128+
;;
129+
success)
130+
success
131+
;;
132+
failure)
133+
failure
134+
;;
135+
restore)
136+
restore
137+
;;
138+
*)
139+
echo "Usage: $0 {before|success|failure|restore}"
140+
exit 1
141+
;;
142+
esac
143+
fi

0 commit comments

Comments
 (0)