diff options
author | nachoparker <nacho@ownyourbits.com> | 2018-01-07 21:01:14 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2018-01-07 21:01:25 +0300 |
commit | 614c57d786e9f48753a5cae19816c85fb75cc940 (patch) | |
tree | 6365cd73cc21555e9778380e154a6a9321013f3e | |
parent | 0972d575735a956550cf8fde89b43b22cb5798f1 (diff) |
nc-restore: refresh trusted domainsv0.44.10
-rwxr-xr-x | bin/nextcloudpi-config | 2 | ||||
-rw-r--r-- | changelog.md | 6 | ||||
-rw-r--r-- | etc/nextcloudpi-config.d/nc-restore.sh | 11 |
3 files changed, 13 insertions, 6 deletions
diff --git a/bin/nextcloudpi-config b/bin/nextcloudpi-config index f247e516..781f4ea2 100755 --- a/bin/nextcloudpi-config +++ b/bin/nextcloudpi-config @@ -42,7 +42,7 @@ function nextcloud-config() local LIST=() for item in $CONFDIR/*.sh; do DESC=$( grep "DESCRIPTION=" "$item" | sed 's|^DESCRIPTION="||;s|"$||' ) - is_active_script "$item" && local ON="✓" || local ON=" " + is_active_script "$item" &>/dev/null && local ON="✓" || local ON=" " LIST+=( "$ON $( basename "$item" .sh )" "$DESC" ) done diff --git a/changelog.md b/changelog.md index f9ae633e..3e08644e 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,9 @@ -[v0.44.9](https://github.com/nextcloud/nextcloudpi/commit/e37978b) (2018-01-07) nc-restore: fix bug detecting data +[v0.44.10](https://github.com/nextcloud/nextcloudpi/commit/b1db925) (2018-01-07) nc-restore: refresh trusted domains -[v0.44.8](https://github.com/nextcloud/nextcloudpi/commit/c42993d) (2018-01-06) nc-restore: restore to a btrfs subvolume +[v0.44.9](https://github.com/nextcloud/nextcloudpi/commit/7dce423) (2018-01-07) nc-restore: fix bug detecting data + +[v0.44.8 ](https://github.com/nextcloud/nextcloudpi/commit/c42993d) (2018-01-06) nc-restore: restore to a btrfs subvolume [v0.44.7 ](https://github.com/nextcloud/nextcloudpi/commit/50513f6) (2018-01-06) nc-backup: make binary work standalone diff --git a/etc/nextcloudpi-config.d/nc-restore.sh b/etc/nextcloudpi-config.d/nc-restore.sh index 725545c0..b24b5d0b 100644 --- a/etc/nextcloudpi-config.d/nc-restore.sh +++ b/etc/nextcloudpi-config.d/nc-restore.sh @@ -39,9 +39,10 @@ configure() rm -rf "$TMPDIR" && mkdir -p "$TMPDIR" # EXTRACT FILES - [[ "$BACKUPFILE_" =~ ".tar.gz" ]] && { + [[ "$BACKUPFILE_" =~ ".tar.gz" ]] && local COMPRESSED=1 || local COMPRESSED=0 + [[ "$COMPRESSED" == "1" ]] && { echo "decompressing backup file $BACKUPFILE_..." - tar -xzf "$BACKUPFILE_" -C "$TMPDIR" || return 1 + tar -xzf "$BACKUPFILE_" -C "$TMPDIR" || return 1 BACKUPFILE_="$( ls "$TMPDIR"/*.tar 2>/dev/null )" [[ -f "$BACKUPFILE_" ]] || { echo "$BACKUPFILE_ not found"; return 1; } } @@ -86,7 +87,8 @@ EOF ### INCLUDEDATA=yes situation - if [[ $( ls "$TMPDIR" | wc -l ) == 2 ]]; then + local NUMFILES=$(( 2 + COMPRESSED )) + if [[ $( ls "$TMPDIR" | wc -l ) -eq $NUMFILES ]]; then local DATADIR=$( grep datadirectory /var/www/nextcloud/config/config.php | awk '{ print $3 }' | grep -oP "[^']*[^']" | head -1 ) [[ "$DATADIR" == "" ]] && { echo "Error reading data directory"; return 1; } @@ -139,6 +141,9 @@ EOF sed -i "s|logpath =.*|logpath = $DATADIR/nextcloud.log|" /etc/fail2ban/jail.conf pgrep fail2ban &>/dev/null && service fail2ban restart + # refresh nextcloud trusted domains + bash /usr/local/bin/nextcloud-domain.sh + rm -r "$TMPDIR" } |