Simple Linux Panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mdserver-web/plugins/ldap/install.sh

44 lines
953 B

3 months ago
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
3 months ago
sysName=`uname`
sysArch=`arch`
3 months ago
VERSION=$2
3 months ago
# https://juejin.cn/post/7309323953683480588
3 months ago
# dpkg-reconfigure slapd
3 months ago
# 该命令将在本地服务器上查找并返回在 “dc=bytedance,dc=local” 这个起点(和其下的所有子目录)下,所有 cn 属性有值的条目的详细信息
# ldapsearch -x -H ldap://localhost -b "dc=bytedance,dc=local" "(cn=*)"
3 months ago
Install_App()
{
echo '正在安装脚本文件...'
3 months ago
apt install -y slapd ldap-utils
3 months ago
mkdir -p $serverPath/ldap
3 months ago
echo "${VERSION}" > $serverPath/ldap/version.pl
3 months ago
echo "${VERSION}安装完成"
3 months ago
}
Uninstall_App()
{
3 months ago
rm -rf $serverPath/ldap/version.pl
3 months ago
echo "卸载ldap成功"
3 months ago
}
action=$1
if [ "${1}" == 'install' ];then
Install_App
else
Uninstall_App
fi