Commit 15c42511 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-sh-functions: add check_su_root

parent 34ee4b9c
......@@ -359,6 +359,19 @@ info()
fi
}
check_su_root()
{
[ "$BASEDISTRNAME" = "alt" ] || return 0
is_root || return 0
echo "$PATH" | grep -q "/usr/sbin" && return 0
fatal "There is missed /usr/sbin path in PATH. Probably you have used 'su' without '-' to get root access. Use 'esu' or 'su -' command to get root permissions."
}
# if we have not sudo, returns 1 and set SUDO variable to fatal
SUDO_TESTED=''
SUDO_CMD='sudo'
......@@ -378,6 +391,8 @@ set_sudo()
return
fi
check_su_root
# if we are root, do not need sudo
is_root && return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment