Skip to content

Commit

Permalink
Merge pull request #72 from ikifar2012/dev
Browse files Browse the repository at this point in the history
Switch to `bashio::config.has_value`
  • Loading branch information
ikifar2012 authored Sep 22, 2022
2 parents b6f76a2 + 90051b9 commit 40df621
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
7 changes: 7 additions & 0 deletions remote-backup/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# 2022.9.3

- Switch to `bashio::config.has_value` to fix #70

**Full Changelog**: https://github.com/ikifar2012/remote-backup-addon/compare/2022.9.2...2022.9.3

# 2022.9.2

- Fix password check #69

**Full Changelog**: https://github.com/ikifar2012/remote-backup-addon/compare/2022.9.1...2022.9.2

# 2022.9.1

- Backup password fix #68
Expand Down
2 changes: 1 addition & 1 deletion remote-backup/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Remote Backup
version: "2022.9.2"
version: "2022.9.3"
slug: remote_backup
description: Automatically create and transfer HA backups using SFTP (SCP), rsync, or rclone (experimental)
image: ikifar/remote-backup-{arch}
Expand Down
10 changes: 5 additions & 5 deletions remote-backup/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function fire-event {
local -r result=${1}
local message=${2:-}

if bashio::var.has_value "${message}"; then
if bashio::config.has_value "${message}"; then
message=",\"message:\":\"${message}\""
fi

Expand Down Expand Up @@ -106,19 +106,19 @@ function create-local-backup {
bashio::log.warning "No password set, creating a local backup without password."
local data="{\"name\":\"${BACKUP_NAME}\"}"
fi
if bashio::var.has_value "${backup_exclude_addons}" || bashio::var.has_value "${backup_exclude_folders}"; then
if bashio::config.has_value "backup_exclude_addons" || bashio::config.has_value "backup_exclude_folders"; then
bashio::log.info "Creating partial backup: \"${BACKUP_NAME}\""

local unformatted_folders="${base_folders}"
local unformatted_addons=$(bashio::supervisor.addons)

if bashio::var.has_value "${backup_exclude_folders}"; then
if bashio::config.has_value "backup_exclude_folders"; then
bashio::log.notice "Excluded folder(s):\n${backup_exclude_folders}"
for folder in ${backup_exclude_folders} ; do
unformatted_folders="${unformatted_folders[@]/$folder}"
done
fi
if bashio::var.has_value "${backup_exclude_addons}"; then
if bashio::config.has_value "backup_exclude_addons"; then
bashio::log.notice "Excluded addon(s):\n${backup_exclude_addons}"
for addon in ${backup_exclude_addons} ; do
unformatted_addons="${unformatted_addons[@]/$addon}"
Expand Down Expand Up @@ -190,7 +190,7 @@ function rsync-folders {

local -r rsync_exclude=$(bashio::config "rsync_exclude" "")
echo "${rsync_exclude}" > /tmp/rsync_exclude.txt
if bashio::var.has_value "rsync_exclude"; then
if bashio::config.has_value "rsync_exclude"; then
bashio::log.notice "Excluded rsync file patterns:\n${rsync_exclude}"
fi

Expand Down

0 comments on commit 40df621

Please sign in to comment.