ncp-update: only root

This commit is contained in:
nachoparker 2017-04-04 18:52:39 +02:00
parent c60ee017ab
commit a3400775c1
2 changed files with 2 additions and 0 deletions

View File

@ -3,6 +3,7 @@
# update latest NextCloudPi code from github
{
[ $(id -u) -ne 0 ] && { printf "Must be run as root. Try 'sudo $0'\n"; exit 1; }
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

View File

@ -267,6 +267,7 @@ EOF
cat > /usr/local/bin/ncp-update <<'EOF'
#!/bin/bash
{
[ $(id -u) -ne 0 ] && { printf "Must be run as root. Try 'sudo $0'\n"; exit 1; }
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