#!/bin/sh FILE=/etc/passwd ROOTSHELL=/sbin/bash # abort if the shell is not there [ -x ${INSTALL_DST}${ROOTSHELL} ] || exit echo "setting shell for root" # create a temporary input file cp ${INSTALL_DST}${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}" ${INSTALL_DST}${FILE}.orig > ${BASE}${FILE} # reset the permissions on the new file to whatever is was # set to during the install perm=`grep "^${FILE} e" ${INSTALL_DST}/var/sadm/install/contents | (read f1 f2 f3 f4 f5 ; echo $f4)` chmod $perm ${INSTALL_DST}${FILE} # remove the temporary file rm -f ${INSTALL_DST}${FILE}.orig