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