Skip to content

Commit

Permalink
Improve config restoration
Browse files Browse the repository at this point in the history
  • Loading branch information
stefaang committed Nov 28, 2020
1 parent e0781c9 commit 6957e7d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion wdpk/rclone/env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

APKG_NAME=rclone
PORT=5572
PORT=5574
RCLONE_USER=mycloud
RCLONE_PW=mycloud
10 changes: 5 additions & 5 deletions wdpk/rclone/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ log=/tmp/debug_apkg
APKG_MODULE="rclone"
APKG_PATH="${path_dst}/${APKG_MODULE}"
APKG_CONFIG="${APKG_PATH}/env"
APKG_BACKUP_CONFIG="/shares/Volume_1/Nas_Prog/rclone.env"
APKG_BACKUP_CONFIG_DIR="${path_dst}/${APKG_MODULE}_backup/"

# install all package scripts to the proper location
mv $path_src $path_dst
Expand Down Expand Up @@ -40,9 +40,9 @@ rm rclone-current-linux-${PLF}.zip
# restore previous config
if [ -f "${APKG_BACKUP_CONFIG}" ]
then
echo "Addon NZBget (install.sh) restore configs" >> $log
cp ${APKG_BACKUP_CONFIG} ${APKG_CONFIG}
rm -f ${APKG_BACKUP_CONFIG}
echo "Addon ${APKG_MODULE} (install.sh) restore configs" >> $log
cp ${APKG_BACKUP_CONFIG_DIR}/* ${APKG_PATH}
rm -rf ${APKG_BACKUP_CONFIG_DIR}
fi
echo "Addon rclone (install.sh) done" >> $log
echo "Addon ${APKG_MODULE} (install.sh) done" >> $log

3 changes: 2 additions & 1 deletion wdpk/rclone/preinst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ APKG_BACKUP_PATH=${APKG_PATH}/../${APKG_MODULE}_backup
if [ ! -d ${APKG_BACKUP_PATH}] ; then
# move config to backup path
mkdir -p ${APKG_BACKUP_PATH}
mv -f ${APKG_PATH}/rclone.config ${APKG_BACKUP_PATH}
mv ${APKG_PATH}/rclone.config ${APKG_BACKUP_PATH}
mv ${APKG_PATH}/env ${APKG_BACKUP_PATH}
fi
2 changes: 1 addition & 1 deletion wdpk/rclone/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script>
function go(){
var my_url = document.domain;
location.href = "http://" + my_url + ":5572";
location.href = "http://" + my_url + ":5574";
}
</script>
</head>
Expand Down

0 comments on commit 6957e7d

Please sign in to comment.