updated to not use bashio and installed jq
This commit is contained in:
@@ -6,6 +6,7 @@ COPY proxmox-backup-client_3.2.7-1_arm64.deb /
|
||||
COPY run.sh /
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y jq
|
||||
RUN apt-get install -y /proxmox-backup-client_3.2.7-1_arm64.deb
|
||||
|
||||
RUN chmod a+x /run.sh
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "PBS-Client",
|
||||
"version": "20240708.14",
|
||||
"version": "20240708.15",
|
||||
"slug": "pbs-client",
|
||||
"description": "Proxmox Backup Client",
|
||||
"url": "https://git.johnhgaunt.com/jgaunt/hassio-addons/src/branch/master/PBS-Client",
|
||||
@@ -10,6 +10,7 @@
|
||||
"host_network": false,
|
||||
"map": ["config", "backup:rw", "ssl", "addons", "share"],
|
||||
"options": {
|
||||
"backup_id": "",
|
||||
"pbs_host": "",
|
||||
"pbs_port": "8007",
|
||||
"pbs_fingerprint": "",
|
||||
@@ -28,6 +29,7 @@
|
||||
]
|
||||
},
|
||||
"schema": {
|
||||
"backup_id": "str",
|
||||
"username": "str",
|
||||
"password": "str",
|
||||
"datastore": "str",
|
||||
|
||||
@@ -1,51 +1,37 @@
|
||||
#!/usr/bin/env bashio
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# grab user variables
|
||||
bashio::log.info "Setting the variables from the config..."
|
||||
AUTH=$(bashio::config 'auth')
|
||||
USERNAME=$(bashio::config 'username')
|
||||
PASSWORD=$(bashio::config 'password')
|
||||
PBS_HOST=$(bashio::config 'pbs_host')
|
||||
PBS_PORT=$(bashio::config 'pbs_port')
|
||||
PBS_FINGERPRINT=$(bashio::config 'pbs_fingerprint')
|
||||
DATASTORE=$(bashio::config 'datastore')
|
||||
NAMESPACE=$(bashio::config 'namespace')
|
||||
INCLUDE=$(bashio::config 'include')
|
||||
DAYS_TO_KEEP=$(bashio::config 'days_to_keep')
|
||||
CONFIG_PATH=/data/options.json
|
||||
|
||||
bashio::log.info "PBS_HOST set to ${PBS_HOST}"
|
||||
bashio::log.info "PBS_PORT set to ${PBS_PORT}"
|
||||
bashio::log.info "PBS_FINGERPRINT set to ${PBS_FINGERPRINT}"
|
||||
bashio::log.info "DATASTORE set to ${DATASTORE}"
|
||||
bashio::log.info "NAMESPACE set to ${NAMESPACE}"
|
||||
bashio::log.info "USERNAME set to ${USERNAME}"
|
||||
bashio::log.info "AUTH set to ${AUTH}"
|
||||
bashio::log.info "INCLUDE set to ${INCLUDE}"
|
||||
bashio::log.info "DAYS_TO_KEEP set to ${DAYS_TO_KEEP}"
|
||||
AUTH=$(jq --raw-output '.auth // empty' $CONFIG_PATH)
|
||||
USERNAME=$(jq --raw-output '.username // empty' $CONFIG_PATH)
|
||||
PASSWORD=$(jq --raw-output '.password // empty' $CONFIG_PATH)
|
||||
PBS_HOST=$(jq --raw-output '.pbs_host // empty' $CONFIG_PATH)
|
||||
PBS_PORT=$(jq --raw-output '.pbs_port // empty' $CONFIG_PATH)
|
||||
PBS_FINGERPRINT=$(jq --raw-output '.pbs_fingerprint // empty' $CONFIG_PATH)
|
||||
DATASTORE=$(jq --raw-output '.datastore // empty' $CONFIG_PATH)
|
||||
NAMESPACE=$(jq --raw-output '.namespace // empty' $CONFIG_PATH)
|
||||
INCLUDE=$(jq --raw-output '.include // empty' $CONFIG_PATH)
|
||||
DAYS_TO_KEEP=$(jq --raw-output '.days_to_keep // empty' $CONFIG_PATH)
|
||||
BACKUP_ID=$(jq --raw-output '.backup_id // empty' $CONFIG_PATH)
|
||||
|
||||
# edit the /.duplicacy/preferences file
|
||||
#bashio::log.info "Creating /.duplicacy/preferences file..."
|
||||
#sed --in-place 's/<BACKUP_ID>/'${BACKUP_ID}'/' /.duplicacy/preferences
|
||||
#sed --in-place 's/<PROTOCOL>/'${PROTOCOL}'/' /.duplicacy/preferences
|
||||
#sed --in-place 's/<SSH_USERNAME>/'${SSH_USERNAME}'/' /.duplicacy/preferences
|
||||
#sed --in-place 's/<SSH_PASSWORD>/'${SSH_PASSWORD}'/' /.duplicacy/preferences
|
||||
#sed --in-place 's/<BACKUP_SERVER>/'${BACKUP_SERVER}'/' /.duplicacy/preferences
|
||||
#sed --in-place 's/<SSH_PORT>/'${SSH_PORT}'/' /.duplicacy/preferences
|
||||
# have to use ~ since the path contains slashes
|
||||
#sed --in-place 's~<BACKUP_SERVER_PATH>~'${BACKUP_SERVER_PATH}'~' /.duplicacy/preferences
|
||||
|
||||
# create the filters file
|
||||
#bashio::log.info "Creating /.duplicacy/filters file..."
|
||||
#for filter in ${FILTERS}; do
|
||||
# echo ${filter} >> /.duplicacy/filters
|
||||
#done
|
||||
echo "PBS_HOST set to ${PBS_HOST}"
|
||||
echo "PBS_PORT set to ${PBS_PORT}"
|
||||
echo "PBS_REPOSITORY set to ${PBS_REPOSITORY}"
|
||||
echo "PBS_FINGERPRINT set to ${PBS_FINGERPRINT}"
|
||||
echo "DATASTORE set to ${DATASTORE}"
|
||||
echo "BACKUP_ID set to ${BACKUP_ID}"
|
||||
echo "NAMESPACE set to ${NAMESPACE}"
|
||||
echo "USERNAME set to ${USERNAME}"
|
||||
echo "AUTH set to ${AUTH}"
|
||||
echo "INCLUDE set to ${INCLUDE}"
|
||||
echo "DAYS_TO_KEEP set to ${DAYS_TO_KEEP}"
|
||||
|
||||
# set environment variables
|
||||
bashio::log.info "Setting environment variables"
|
||||
echo "Setting environment variables"
|
||||
export PBS_PASSWORD="${PASSWORD}"
|
||||
export PBS_REPOSITORY="${USERNAME}@${AUTH}@${PBS_HOST}:${PBS_PORT}:${DATASTORE}"
|
||||
export PBS_FINGERPRINT="${PBS_FINGERPRINT}"
|
||||
bashio::log.info "PBS_REPOSITORY set to ${PBS_REPOSITORY}"
|
||||
|
||||
|
||||
INCLUDE_DEV=""
|
||||
@@ -53,7 +39,7 @@ for I in ${INCLUDE}; do
|
||||
INCLUDE_DEV+="${I}.pxar:/${I}"
|
||||
done
|
||||
|
||||
bashio::log.info "INCLUDE_DEV set to ${INCLUDE_DEV}"
|
||||
echo "INCLUDE_DEV set to ${INCLUDE_DEV}"
|
||||
|
||||
/usr/bin/proxmox-backup-client version
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user