client_setup: add run as root check

This commit is contained in:
Arthur Golubtsov
2019-03-29 08:40:00 +00:00
parent 9cd0227717
commit f0a93f5a09

View File

@@ -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"