Increase users in batches

xiaoxiao2021-03-06  78

http://bbs.chinaunix.net/forum/viewtopic.php?t=405818&highlight= Bulk Newcmd reads the mass of "Summer of Zero" to increase the user's script, there are several places don't understand #! / bin / sh #Name: smbadd #Des: To add some samba user #Author: PopZslam _PASSWD = 123456 _SMBNAME = _SMBGROUP = samba #Sorry, I forget the samba group's name.You can edit this script and input the currect name myAdd () {. AddUser $ _SMBNAME -G $ _SMBGROUP Echo "The Smbuser" $ _SMBNAME "is added to" $ _smbgroup! echo "set password for smbuser" echo $ _passwd | passwd $ _smbname --stdin} userlist () {i [-f ~ / SMBUserList]; THEN i = 1 while _num = `head -n $ i ~ / smbuserlist | awk '$ 1 == i {Printf"% s ", $ 1; next;}' i =" $ i "` do ix [- Z $ _NUM]; THEN Echo "There is no user to add !!" EXIT 0 else _smbname = `awk '$ 1 == i {Printf"% s ", $ 2; next;}' i =" $ i "~ / SMBUserList` MyAdd i = `expr $ i 1` Fi Done else echo" You Must Create a file named / "smbuserlist /" first! "fi} # mail part userlist #end red place is not too understanding, but I am based on myself The understanding has made some modifications, making users who can add different passwords. I don't understand, I hope the master will explain it. Here is my script, welcome to correct.

转载请注明原文地址:https://www.9cbs.com/read-93283.html

New Post(0)