Nico0084 / domogik-plugin-ozwave

Domogik ozwave plugin
GNU General Public License v3.0
1 stars 0 forks source link

sudo in install_dependencies.sh #29

Closed piratebab closed 7 years ago

piratebab commented 7 years ago

when using install_dependencies.sh I got the error message ./install_dependencies.sh: line 190: sudo: command not found using sudo is not a good idea. sudo is not install in usual server distribution. and as the script is launched as root, why sudo ?

fritz-smh commented 7 years ago

I don't agree with you. Except on debian, sudo is used by default in most of linux distributions.

In the domogik install doc we require to install sudo, so you should have installed sudo ;)

By the way, the script should be only run by root. See the code :

# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
    echo "This script must be run as root" 1>&2
    exit 1
fi

So the script should be run like this :

(root prompt) # ./install_dependencies.sh

Or :

(a user prompt) $ sudo ./install_dependencies.sh

So indeed, no sudo should be needed in this script.

piratebab commented 7 years ago

i have erased the useless sudo in the script , and it works