Skip to content

Commit

Permalink
ncp-update: only root
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Apr 4, 2017
1 parent c60ee01 commit a340077
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions bin/ncp-update
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions nextcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a340077

Please sign in to comment.