#!/bin/sh echo "setting shell for root" FILE=${INSTALL_DST}/etc/passwd # History lesson: # # Aeons ago, /sbin used to contain statically linked binaries, # so that if your shared libraries were unavailable you could still fix stuff. # # These days, everything is dynamically linked, so a special static version # of bash is no longer required (which is good, because it was a pain to build) # # We still need to copy /bin/bash to /sbin/bash, # because /bin is a symlink to /usr/bin, and /usr might be unavailable. # if [ ! -f -f ${INSTALL_DST}/sbin/bash ] then if [ -f ${INSTALL_DST}/bin/bash ] then echo "copying /bin/bash to /sbin" cp -p ${INSTALL_DST}/bin/bash ${INSTALL_DST}/sbin/bash fi fi # set root's shell to bash USER=root SHELL=/sbin/bash # abort if the shell is not there [ -x ${INSTALL_DST}${SHELL} ] || exit TFILE=${FILE}.$$ sed -e "s%^${USER}:\(.*\):.*$%${USER}:\1:${SHELL}%" < ${FILE} > ${TFILE} mv ${TFILE} ${FILE} # reset the permissions on the new file to whatever is was # set to during the install IFILE=`echo ${FILE} | sed -e "s|^${INSTALL_DST}||g"` PERM=`grep "^${IFILE} e" ${INSTALL_DST}/var/sadm/install/contents | (read f1 f2 f3 f4 f5 ; echo $f4)` chmod ${PERM} ${FILE}