File tree Expand file tree Collapse file tree 2 files changed +32
-26
lines changed Expand file tree Collapse file tree 2 files changed +32
-26
lines changed Original file line number Diff line number Diff line change 22
33# update latest NextCloudPi code from github
44
5- ping -W 2 -w 1 -q github.com & > /dev/null || { echo " No internet connectivity" ; exit 1; }
6- echo -e " Downloading updates"
7- rm -rf /tmp/ncp-update-tmp
8- git clone -q --depth 1 https://github.com/nachoparker/nextcloud-raspbian-generator.git /tmp/ncp-update-tmp || exit 1
9- cd /tmp/ncp-update-tmp
5+ {
6+ ping -W 2 -w 1 -q github.com & > /dev/null || { echo " No internet connectivity" ; exit 1; }
7+ echo -e " Downloading updates"
8+ rm -rf /tmp/ncp-update-tmp
9+ git clone -q --depth 1 https://github.com/nachoparker/nextcloud-raspbian-generator.git /tmp/ncp-update-tmp || exit 1
10+ cd /tmp/ncp-update-tmp
1011
11- echo -e " Performing updates"
12- ./update.sh
12+ echo -e " Performing updates"
13+ ./update.sh
1314
14- VER=$( git describe --always --tags )
15- echo $VER > /usr/local/etc/ncp-version
16- echo $VER > /var/run/.ncp-latest-version
15+ VER=$( git describe --always --tags )
16+ echo $VER > /usr/local/etc/ncp-version
17+ echo $VER > /var/run/.ncp-latest-version
1718
18- cd /
19- rm -rf /tmp/ncp-update-tmp
19+ cd /
20+ rm -rf /tmp/ncp-update-tmp
2021
21- echo -e " NextCloudPi updated to version \e[1m$VER \e[0m"
22+ echo -e " NextCloudPi updated to version \e[1m$VER \e[0m"
23+ exit
24+ } # force to read the whole thing into memory, as its contents might change in update.sh
Original file line number Diff line number Diff line change @@ -266,23 +266,26 @@ EOF
266266
267267 cat > /usr/local/bin/ncp-update << 'EOF '
268268#!/bin/bash
269- ping -W 2 -w 1 -q github.com &>/dev/null || { echo "No internet connectivity"; exit 1; }
270- echo -e "Downloading updates"
271- rm -rf /tmp/ncp-update-tmp
272- git clone -q --depth 1 https://github.com/nachoparker/nextcloud-raspbian-generator.git /tmp/ncp-update-tmp || exit 1
273- cd /tmp/ncp-update-tmp
269+ {
270+ ping -W 2 -w 1 -q github.com &>/dev/null || { echo "No internet connectivity"; exit 1; }
271+ echo -e "Downloading updates"
272+ rm -rf /tmp/ncp-update-tmp
273+ git clone -q --depth 1 https://github.com/nachoparker/nextcloud-raspbian-generator.git /tmp/ncp-update-tmp || exit 1
274+ cd /tmp/ncp-update-tmp
274275
275- echo -e "Performing updates"
276- ./update.sh
276+ echo -e "Performing updates"
277+ ./update.sh
277278
278- VER=$( git describe --always --tags )
279- echo $VER > /usr/local/etc/ncp-version
280- echo $VER > /var/run/.ncp-latest-version
279+ VER=$( git describe --always --tags )
280+ echo $VER > /usr/local/etc/ncp-version
281+ echo $VER > /var/run/.ncp-latest-version
281282
282- cd /
283- rm -rf /tmp/ncp-update-tmp
283+ cd /
284+ rm -rf /tmp/ncp-update-tmp
284285
285- echo -e "NextCloudPi updated to version \e[1m$VER\e[0m"
286+ echo -e "NextCloudPi updated to version \e[1m$VER\e[0m"
287+ exit
288+ }
286289EOF
287290 chmod a+x /usr/local/bin/ncp-update
288291
You can’t perform that action at this time.
0 commit comments