Koozali.org: home of the SME Server

add multiple ibays

vanLunteren

add multiple ibays
« on: March 03, 2002, 03:06:10 PM »
There is a script to add and delete multiple users to e-smith.
I'm looking for the same script but for ibays.

Thanks Theo

vanLunteren

Re: add multiple ibays
« Reply #1 on: March 08, 2002, 07:37:08 PM »
nobody can fix this problem ??

Scott Smith

Re: add multiple ibays
« Reply #2 on: March 08, 2002, 08:54:29 PM »
Adding ibays is not much different. Use the db command to create the ibay entries in the accounts file, then signal the ibay-create event.

The db command would look something like this:

/sbin/e-smith/db accounts set NAME ibay Group GROUPNAME Name "DESCRIPTIVE NAME" PasswordSet no PublicAccess local-pw UserAccess wr-group-rd-group

Replace the UPPERCASE words with the specifics for your ibay. The valid options for PublicAccess are:

local
local-pw
global
global-pw
global-pw-remote

The valid options for UserAccess are:

wr-group-rd-group
wr-group-rd-everyone
wr-admin-rd-group

The next step is to signal the event to create the ibay.

/sbin/e-smith/signal-event ibay-create NAME

where NAME is the name of the ibay.

That's the gist of it. Look at the script to create users, modify the db and signal-event calls accordingly, and you should be in business. I think the only other thing you'd need to look at is setting the password for the ibay. That, too, should be similar to the way it is done for users.

HTH

Scott

vanLunteren

Re: add multiple ibays
« Reply #3 on: March 08, 2002, 08:57:51 PM »
thanks Scott i try it

vanLunteren

Re: add multiple ibays
« Reply #4 on: March 08, 2002, 11:09:27 PM »
Anyone can change this script for ibays ??
http://myezserver.com/downloads/mitel/howto/addusers-howto.html

The script below will read in a text file containing user information and automatically create and set up e-smith user accounts.  This is perfect for quickly adding multiple users to e-smith.
Simply cut and paste the entire script below (including the last line "done") into a file called e-smith-adduser.sh

Then create a text file called adduserlist.txt with the following format:

USERNAME1:FIRSTNAME1:LASTNAME1
USERNAME2:FIRSTNAME2:LASTNAME2

and place both the files in the /root directory.

To execute, login as root, change to the /root directory and enter (including the "."):

[root@e-smith /root]# . e-smith-adduser.sh
 

--------------------------------------------------------------------------------
 
#!/bin/sh
#
# USAGE:
#
# Create the file /root/adduserlist.txt in the following format:
#
# USERNAME1:FIRSTNAME1:LASTNAME1
# USERNAME2:FIRSTNAME2:LASTNAME2
#
# and so on...
#
# This script will create user accounts, mail accounts and pseudonyms for all the listed users in the /root/adduserlist.txt file.
#
# NOTE *By default usernames/passwords are set to the same value*
#

UFILE=/root/adduserlist.txt

if [ ! -f $UFILE ]; then
echo User database $UFILE missing
exit
fi

# export record=cat $UFILE
# if [ "$record" != "" ]; then

# --------------------------
# Make sure the lines below are all indented as shown
# --------------------------
   for record in cat $UFILE
   do
   username=echo $record | awk -F":" {'print $1'}
   firstname=echo $record | awk -F":" {'print $2'}
   lastname=echo $record | awk -F":" {'print $3'}
   uid=echo $record | awk -F":" {'print $4'}
   number=$RANDOM

# ----------------------
# Set values for account
# ----------------------
#
# Available values and options are shown below as 'option' :
#
# FirstName $firstname
# LastName $lastname
# Dept 'department'
# Company 'company name'
# Street 'address'
# City 'city, postal, prov/state, country'
# Phone 'phone number'
# EmailForward 'local, forward, both'
# ForwardAddress 'leave blank or enter forward address'
#
# Below are the minimum values with no changes required
#
/sbin/e-smith/db accounts set $username user FirstName $firstname LastName $lastname PasswordSet no Uid $number Gid $number

# ---------------
# Create Account
# ---------------
/sbin/e-smith/signal-event user-create $username

# ---------------
# Pause Script, bug reported by Jeffrey Smith
# ---------------
sleep 3

# ----------------
# Create Password
# -----------------------------------------------------
# (in this case the username and password are the same)
# eg: ( '$username', 'PASSWORD' );"
# -----------------------------------------------------
perl -e "use esmith::util; esmith::util::setUserPassword ( '$username', '$username' );"

# ---------------------------------
# Set value for password as created
# ---------------------------------
/sbin/e-smith/db accounts setprop $username PasswordSet yes

# ---------------------------------------------------------
# Create Pseudonym (FIRSTNAME.LASTNAME@domain.org)
# Create Pseudonym (FIRSTNAME_LASTNAME@domain.org)
# (simple comment these lines out to not create Pseudonyms)
# ---------------------------------------------------------
/sbin/e-smith/signal-event pseudonym-create $firstname.$lastname $username
/sbin/e-smith/signal-event pseudonym-create $firstname_$lastname $username

done
 

--------------------------------------------------------------------------------