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 ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| "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 |
| ||||
| 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. |