#!/bin/sh FILE=/etc/passwd ROOTSHELL=/sbin/bash # abort if the shell is not there [ -x ${BASE}${ROOTSHELL} ] || exit echo "setting shell for root" # create a temporary input file cp ${BASE}${FILE} ${BASE}${FILE}.orig nawk -F: '{ if ( $1 == "root" ) printf"%s:%s:%s:%s:%s:%s:%s\n",$1,$2,$3,$4,$5,$6,shell else printf"%s:%s:%s:%s:%s:%s:%s\n",$1,$2,$3,$4,$5,$6,$7 }' shell="${ROOTSHELL}" ${BASE}${FILE}.orig > ${BASE}${FILE} # reset the permissions on the new file to whatever is was # set to during the install perm=`grep "^${FILE} e" ${BASE}/var/sadm/install/contents | (read f1 f2 f3 f4 f5 ; echo $f4)` chmod $perm ${BASE}${FILE} # remove the temporary file rm -f ${BASE}${FILE}.orig