Skip to content

Commit

Permalink
check permissions
Browse files Browse the repository at this point in the history
Now we check for sudo/root privileges before installation.
  • Loading branch information
QROkes committed Nov 2, 2018
1 parent 5869e4e commit e27fdf4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion weby
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ if ! [[ $distr == "Ubuntu" && $osver =~ ^(xenial|bionic)$ ]]; then
echo "**** This OS is not supported by Webinoly and could not work properly ****"
echo "****************************************************************************"
echo "$(tput sgr0)"
read -p "Press [Enter] key to continue..."
read -p "Press [Enter] key to Continue or [Ctrl+C] to Cancel..."
fi
# Check for sudo/root privileges
if ! groups $USERNAME | grep &>/dev/null '\bsudo\b' | groups $USERNAME | grep &>/dev/null '\broot\b'; then
echo "$(tput setaf 1)"
echo "**** [ERROR] sudo/root privileges are required to install Webinoly ****"
echo "$(tput sgr0)"
read -p "Press [Enter] key to Continue or [Ctrl+C] to Cancel..."
fi

# In case client is just Updating Webinoly and not fresh-installing we need accurate statistics.
Expand Down

0 comments on commit e27fdf4

Please sign in to comment.