-
-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix ncp-update with no internet access
- Loading branch information
1 parent
eaf3fe7
commit 1c19f4c
Showing
5 changed files
with
44 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
# update latest available version in /var/run/.ncp-latest-version | ||
|
||
[ $(id -u) -ne 0 ] && exit 1 | ||
|
||
ping -W 2 -w 1 -q github.com &>/dev/null || { echo "No internet connectivity"; exit 1; } | ||
|
||
git clone -q --depth 1 https://github.com/nachoparker/nextcloud-raspbian-generator.git /tmp/ncp-check-tmp || exit 1 | ||
|
||
cd /tmp/ncp-check-tmp | ||
git describe --always --tags > /var/run/.ncp-latest-version | ||
cd / | ||
|
||
rm -rf /tmp/ncp-check-tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# update latest NextCloudPi code from github | ||
|
||
ping -W 2 -w 1 -q github.com &>/dev/null || { echo "No internet connectivity"; exit 1; } | ||
echo -e "Downloading updates" | ||
rm -rf /tmp/ncp-update-tmp | ||
git clone -q --depth 1 https://github.com/nachoparker/nextcloud-raspbian-generator.git /tmp/ncp-update-tmp || exit 1 | ||
cd /tmp/ncp-update-tmp | ||
|
||
echo -e "Performing updates" | ||
./update.sh | ||
|
||
VER=$( git describe --always --tags ) | ||
echo $VER > /usr/local/etc/ncp-version | ||
echo $VER > /var/run/.ncp-latest-version | ||
|
||
cd / | ||
rm -rf /tmp/ncp-update-tmp | ||
|
||
echo -e "NextCloudPi updated to version \e[1m$VER\e[0m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters