Unix Technical Forum

scripting mkuser

This is a discussion on scripting mkuser within the AIX Operating System forums, part of the Unix Operating Systems category; --> Hi, I'm making a script that creates a user and syncs that with an other machine. I was wondering ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008, 10:54 AM
relikwie
 
Posts: n/a
Default scripting mkuser

Hi,

I'm making a script that creates a user and syncs that with an other
machine.
I was wondering what the exit codes are that mkuser can return? Like
user already exists etc.



_sync ()
{
UFl='/etc/passwd /etc/group'
UFlSec='/etc/security/passwd /etc/security/group'
UDn='host2:/etc/'
UDnSec='host2:/etc/security/'
/usr/bin/rcp $UFl $UDn
/usr/bin/rcp $UFlSec $UDnSec
if [[ -d /home/${1} ]] ; then /usr/bin/rcp -rp /home/${1} host2:/home/
; fi
}
mkuser pgrp='mls' home="/home/${1}" shell='/usr/bin/ksh' gecos="${2}"
${1}
_sync



regards

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-05-2008, 10:54 AM
Clive George
 
Posts: n/a
Default Re: scripting mkuser

"relikwie" <relikwie@googlemail.com> wrote in message
news:1165240462.374274.237940@f1g2000cwa.googlegro ups.com...
> Hi,
>
> I'm making a script that creates a user and syncs that with an other
> machine.
> I was wondering what the exit codes are that mkuser can return? Like
> user already exists etc.


Dunno off the top of my head. I'd try it and see. I suspect you'll be
wanting to look at the output from mkuser, rather than just the exit code.

cheers,
clive

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-05-2008, 10:55 AM
aix@mail.com
 
Posts: n/a
Default Re: scripting mkuser


relikwie wrote:
> Hi,
>
> I'm making a script that creates a user and syncs that with an other
> machine.
> I was wondering what the exit codes are that mkuser can return? Like
> user already exists etc.
>
>
>
> _sync ()
> {
> UFl='/etc/passwd /etc/group'
> UFlSec='/etc/security/passwd /etc/security/group'
> UDn='host2:/etc/'
> UDnSec='host2:/etc/security/'
> /usr/bin/rcp $UFl $UDn
> /usr/bin/rcp $UFlSec $UDnSec
> if [[ -d /home/${1} ]] ; then /usr/bin/rcp -rp /home/${1} host2:/home/
> ; fi
> }
> mkuser pgrp='mls' home="/home/${1}" shell='/usr/bin/ksh' gecos="${2}"
> ${1}
> _sync
>
>
>
> regards


not particularly an answer to your question, but I'd say it would be
safer to rsh the mkuser command rather than rcp the files. safer still
would be to use ssh / scp.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:25 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com