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 2
2
3
3
# update latest NextCloudPi code from github
4
4
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
10
11
11
- echo -e " Performing updates"
12
- ./update.sh
12
+ echo -e " Performing updates"
13
+ ./update.sh
13
14
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
17
18
18
- cd /
19
- rm -rf /tmp/ncp-update-tmp
19
+ cd /
20
+ rm -rf /tmp/ncp-update-tmp
20
21
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
266
266
267
267
cat > /usr/local/bin/ncp-update << 'EOF '
268
268
#!/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
274
275
275
- echo -e "Performing updates"
276
- ./update.sh
276
+ echo -e "Performing updates"
277
+ ./update.sh
277
278
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
281
282
282
- cd /
283
- rm -rf /tmp/ncp-update-tmp
283
+ cd /
284
+ rm -rf /tmp/ncp-update-tmp
284
285
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
+ }
286
289
EOF
287
290
chmod a+x /usr/local/bin/ncp-update
288
291
You can’t perform that action at this time.
0 commit comments