diff options
author | nachoparker <nacho@ownyourbits.com> | 2017-07-31 15:48:10 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2017-08-11 00:17:56 +0300 |
commit | d819bbb625ebc9c63d9f4f43ce62a2f145c84a2c (patch) | |
tree | 7c7b12c6ebfcd55a81be8a83b34180eaf303c353 /etc/nextcloudpi-config.d/nc-restore.sh | |
parent | c4210c5a69b611b5cc2f779b381699eecb9d0e71 (diff) |
simplify parametersv0.18.5
Diffstat (limited to 'etc/nextcloudpi-config.d/nc-restore.sh')
-rw-r--r-- | etc/nextcloudpi-config.d/nc-restore.sh | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/etc/nextcloudpi-config.d/nc-restore.sh b/etc/nextcloudpi-config.d/nc-restore.sh index 2c8e6cfe..4d79810d 100644 --- a/etc/nextcloudpi-config.d/nc-restore.sh +++ b/etc/nextcloudpi-config.d/nc-restore.sh @@ -18,7 +18,7 @@ BACKUPFILE_=/media/USBdrive/nextcloud-bkp_xxxxxxxx.tar -BASEDIR_=/var/www +BASEDIR=/var/www DBADMIN=ncadmin DESCRIPTION="Restore a previously backuped NC instance" @@ -39,9 +39,9 @@ You can use nc-backup " \ configure() { - [ -f $BACKUPFILE_ ] || { echo -e "$BACKUPFILE_ not found"; return 1; } - [ -d $BASEDIR_ ] || { echo -e "$BASEDIR_ not found"; return 1; } - [ -d $BASEDIR_/nextcloud ] && { echo -e "WARNING: overwriting old instance"; } + [ -f $BACKUPFILE_ ] || { echo -e "$BACKUPFILE_ not found"; return 1; } + [ -d $BASEDIR ] || { echo -e "$BASEDIR not found"; return 1; } + [ -d $BASEDIR/nextcloud ] && { echo -e "WARNING: overwriting old instance"; } local TMPDIR="$( dirname $BACKUPFILE_ )/$( basename ${BACKUPFILE_}-tmp )" rm -rf "$TMPDIR" && mkdir -p "$TMPDIR" @@ -50,8 +50,8 @@ configure() ## RESTORE FILES echo -e "restore files..." - rm -rf $BASEDIR_/nextcloud - mv "$TMPDIR"/nextcloud $BASEDIR_ + rm -rf $BASEDIR/nextcloud + mv "$TMPDIR"/nextcloud $BASEDIR ## RE-CREATE DATABASE TABLE @@ -72,12 +72,12 @@ EOF ## RESTORE DATADIR - cd $BASEDIR_/nextcloud + cd $BASEDIR/nextcloud # INCLUDEDATA=yes situation if [[ $( ls "$TMPDIR" | wc -l ) == 2 ]]; then - local DATADIR=$( grep datadirectory $BASEDIR_/nextcloud/config/config.php | awk '{ print $3 }' | grep -oP "[^']*[^']" | head -1 ) + local DATADIR=$( grep datadirectory $BASEDIR/nextcloud/config/config.php | awk '{ print $3 }' | grep -oP "[^']*[^']" | head -1 ) [[ "$DATADIR" == "" ]] && { echo -e "Error reading data directory"; return 1; } echo -e "restore datadir to $DATADIR..." rm -rf "$DATADIR" @@ -107,7 +107,7 @@ EOF rm -r "$TMPDIR" # Just in case we moved the opcache dir - sed -i "s|^opcache.file_cache=.*|opcache.file_cache=$BASEDIR_/nextcloud/data/.opcache|" /etc/php/7.0/mods-available/opcache.ini + sed -i "s|^opcache.file_cache=.*|opcache.file_cache=$BASEDIR/nextcloud/data/.opcache|" /etc/php/7.0/mods-available/opcache.ini } install() { :; } |