1
0
mirror of https://github.com/jumpserver/jumpserver.git synced 2025-05-12 02:02:10 +00:00
jumpserver/sudodel.sh
2014-08-21 18:19:06 +08:00

18 lines
345 B
Bash
Executable File

#!/bin/bash
username=$1
password=$2
cwd (){
dir=$0
dirname $dir
}
dir=$(cwd)
. ${dir}/shell.conf
id $username &> /dev/null
if [ $? == '0' ];then
userdel -r $username
else
echo "$username is not exist."
fi
ldapdelete -x -h $host -D "cn=admin,dc=$domain,dc=$suffix" -w $ldapassword "cn=$username,ou=Sudoers,dc=$domain,dc=$suffix"