Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
PietsHost committed Sep 30, 2017
2 parents ca9ce49 + adab47e commit d8e6c2b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ That's it! Visit your website and enjoy the latest version of Nextcloud!


# Usage
Simply change lines 22 - 34 to suit your needs:
Simply change lines 22 - 35 to suit your needs:
```
# Directories - change the following lines to suit your needs
html=/var/www/html # root html directory
Expand All @@ -48,8 +48,11 @@ chmod +x ./ncupdate.sh
```
By default, the script will leave the folders "data", "config", "apps" and "themes" within your nextcloud path. <br />
That's usefull for example if you have mass data and copying data to another folder would take too long..<br />

You can enable a file backup (copy data files to another folder) by starting the script with "-b" option:<br />
``./ncupdate.sh -b`` or ``./ncupdate.sh --backup``
``./ncupdate.sh -b``<br />
"-d" enables backup of external data directory, e.g. it's stored in ``/home/data``:<br />
``./ncupdate.sh -bd /home/data``

## Notes
* Tested on CentOS 6.8 & 7.3
Expand Down
25 changes: 5 additions & 20 deletions ncupdate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ echo "make a new, fresh installation and then restore your data from backup."
echo
echo "Checking versions in 5 seconds.."

progress_bar() {
echo -ne ' |====> | (20%)\r'
sleep 1
echo -ne ' |=======> | (40%)\r'
Expand All @@ -171,6 +172,8 @@ echo -ne ' |===============> | (80%)\r'
sleep 1
echo -ne ' |===================>| (100%)\r'
echo -ne '\n'
}
progress_bar

# Check if new version is larger than current version installed.
function version_gt() { local v1 v2 IFS=.; read -ra v1 <<< "$1"; read -ra v2 <<< "$2"; printf -v v1 %03d "${v1[@]}"; printf -v v2 %03d "${v2[@]}"; [[ $v1 > $v2 ]]; }
Expand Down Expand Up @@ -199,16 +202,7 @@ else
fi
echo "Press CTRL+C to abort."

printf " |===> | (20%%)\r"
sleep 1
printf " |=======> | (40%%)\r"
sleep 1
printf " |===========> | (60%%)\r"
sleep 1
printf " |===============> | (80%%)\r"
sleep 1
printf " |===================>| (100%%)\r"
printf "\n"
progress_bar

if [[ "$backupenabled" == "true" ]]; then
# Backup data
Expand Down Expand Up @@ -395,16 +389,7 @@ fi
echo "Removing old Nextcloud files in 5 seconds..."
fi

echo -ne ' |====> | (20%)\r'
sleep 1
echo -ne ' |=======> | (40%)\r'
sleep 1
echo -ne ' |===========> | (60%)\r'
sleep 1
echo -ne ' |===============> | (80%)\r'
sleep 1
echo -ne ' |===================>| (100%)\r'
echo -ne '\n'
progress_bar

if [[ "$backupenabled" == "true" ]]; then
rm -rf $ncpath
Expand Down

0 comments on commit d8e6c2b

Please sign in to comment.