将shell中内容提取到配置文件中,修改base.html

pull/1/head
guanghongwei 2014-08-15 19:06:38 +08:00
parent a19a8e86df
commit 7b299478a8
8 changed files with 11 additions and 16 deletions

View File

@ -3,7 +3,7 @@
if [ $USER = 'admin' ] || [ $USER == 'root' ];then
echo ""
else
python /opt/jumpserver/jumpserver.pyo
python /opt/jumpserver/jumpserver.py
if [ $USER == 'guanghongwei' ];then
echo
else

0
logs/test.log Normal file
View File

View File

@ -2,5 +2,7 @@
host=127.0.0.1
ldapassword=VNLqNCjpNBIetEoCA2h3
domain=dianping
suffix=com
#host2=172.16.2.74
#host2_port=2001

View File

@ -29,4 +29,4 @@ fi
sed -e "s@guanghongwei@$username@g" ${sudo_file} > $user_sudo_file
ldapadd -x -h ${host} -w ${ldapassword} -D "cn=admin,dc=yolu,dc=com" -f $user_sudo_file
ldapadd -x -h ${host} -w ${ldapassword} -D "cn=admin,dc=$domain,dc=$suffix" -f $user_sudo_file

View File

@ -15,4 +15,4 @@ if [ $? == '0' ];then
else
echo "$username is not exist."
fi
ldapdelete -x -h $host -D "cn=admin,dc=yolu,dc=com" -w $ldapassword "cn=$username,ou=Sudoers,dc=yolu,dc=com"
ldapdelete -x -h $host -D "cn=admin,dc=$domain,dc=$suffix" -w $ldapassword "cn=$username,ou=Sudoers,dc=$domain,dc=$suffix"

View File

@ -31,8 +31,8 @@ cd /usr/share/migrationtools/
./migrate_passwd.pl /etc/passwd > /tmp/passwd.ldif
./migrate_group.pl /etc/group > /tmp/group.ldif
grep -A15 "dn: uid=$username,ou=People,dc=yolu,dc=com" /tmp/passwd.ldif > /tmp/user.ldif
grep -A6 "dn: cn=$username,ou=Group,dc=yolu,dc=com" /tmp/group.ldif > /tmp/usergroup.ldif
grep -A15 "dn: uid=$username,ou=People,dc=$domain,dc=$suffix" /tmp/passwd.ldif > /tmp/user.ldif
grep -A6 "dn: cn=$username,ou=Group,dc=$domain,dc=$suffix" /tmp/group.ldif > /tmp/usergroup.ldif
ldapadd -x -h $host -w $ldapassword -D "cn=admin,dc=yolu,dc=com" -f /tmp/user.ldif
ldapadd -x -h $host -w $ldapassword -D "cn=admin,dc=yolu,dc=com" -f /tmp/usergroup.ldif
ldapadd -x -h $host -w $ldapassword -D "cn=admin,dc=$domain,dc=$suffix" -f /tmp/user.ldif
ldapadd -x -h $host -w $ldapassword -D "cn=admin,dc=$domain,dc=$suffix" -f /tmp/usergroup.ldif

View File

@ -17,6 +17,5 @@ if [ $? == '0' ];then
else
echo "$username is not exist."
fi
ldapdelete -x -h $host -D "cn=admin,dc=yolu,dc=com" -w $ldapassword "uid=$username,ou=People,dc=yolu,dc=com"
ldapdelete -x -h $host -D "cn=admin,dc=yolu,dc=com" -w $ldapassword "cn=$username,ou=Group,dc=yolu,dc=com"
ldapdelete -x -h $host -D "cn=admin,dc=$domain,dc=$suffix" -w $ldapassword "uid=$username,ou=People,dc=$domain,dc=$suffix"
ldapdelete -x -h $host -D "cn=admin,dc=$domain,dc=$suffix" -w $ldapassword "cn=$username,ou=Group,dc=$domain,dc=$suffix"

View File

@ -27,7 +27,6 @@
<li class="{{ index }}"><a href="/">主页</a></li>
<li class="{{ pass_menu }}"><a href="/chgPass/">密码管理</a></li>
<!--<li><a href="#">命令执行</a></li>-->
<li class="{{ vpn_menu }}"><a href="/chgPptp/">VPN管理</a></li>
</ul>
<div class="btn-group navbar-right">
<button type="button" class="btn btn-primary dropdown-toggle session_btn" data-toggle="dropdown">
@ -53,11 +52,6 @@
<li><a href="/chgPass/"><i class="glyphicon glyphicon-send"></i> 登陆密码</a></li>
<li><a href="/chgKey/"><i class="glyphicon glyphicon-send"></i> 密钥密码</a></li>
</ul>
<div class="menu-first" ><a href="#monitorMenu" data-toggle="collapse"><i class="glyphicon glyphicon-th"></i> VPN管理</a></div>
<ul id="monitorMenu" class="nav nav-list navbar-collapse.in menu-second">
<li><a href="/chgPptp/"><i class="glyphicon glyphicon-send"></i> PPTP密码</a></li>
<li><a href="/chgOpenvpn/"><i class="glyphicon glyphicon-send"></i> OpenVPN</a></li>
</ul>
</div>
</div>
</div>