#check if there is sudo installed, AND if the current user is a sudoer.
This commit is contained in:
neil committed 2016-01-27 13:15:12 +08:00
1 parent f0252b91c9
commit b3a2aac829
1 file changed
+8 -1
+8 -1
View File
@@ -260,7 +260,14 @@ _stopserver() {
}
_initpath() {
SUDO="$(command -v sudo | grep -o 'sudo')"
#check if there is sudo installed, AND if the current user is a sudoer.
if command -v sudo > /dev/null ; then
if [ "$(sudo -n uptime 2>&1|grep "load"|wc -l)" != "0" ] ; then
SUDO=sudo
fi
fi
if [ -z "$API" ] ; then
if [ -z "$STAGE" ] ; then
API="$DEFAULT_CA"
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.