From f0a93f5a0988f021ae72daa7583e8effb8af113c Mon Sep 17 00:00:00 2001 From: Arthur Golubtsov Date: Fri, 29 Mar 2019 08:40:00 +0000 Subject: [PATCH] client_setup: add run as root check --- Drone/client_setup.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Drone/client_setup.sh b/Drone/client_setup.sh index ac5016e..e188f57 100755 --- a/Drone/client_setup.sh +++ b/Drone/client_setup.sh @@ -4,6 +4,11 @@ # $3 - hostname of rpi # $4 - server ip +if [ $(whoami) != "root" ]; then + echo -e "\nThis should be run as root!\n" + exit 1 +fi + # check if enough arguments if [[ $# -ne 4 ]] ; then echo -e "\nPlease, enter arguments: router ssid, wifi password, copter id and server ip"