#!/bin/bash source ../functions/main cat > /etc/default/useradd << "EOF" # useradd defaults file HOME=/home INACTIVE=-1 EXPIRE= SHELL=/bin/bash SKEL=/etc/skel CREATE_MAIL_SPOOL=yes EOF chmod -v 644 /etc/default/useradd echo "Copying /etc/skel files to root directory" # First create a copy to change owner cp -au /etc/skel/.??* /root # Fixing ownership of directories /tmp and /var/log (may have been created by # a regular user when fetching packages). chown -v root:root /tmp chown -v root:root /var chown -v root:root /var/log # Removing /tools from PATH: SED_REP='/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin' sed -i -e "s!^\(PATH=\).*tools.*!\1${SED_REP}!" /etc/profile # Removing /tools directory if [ -d /tools ]; then DEST=/usr/src/tools if [ -d ${DEST} ]; then # Remove old backup rm -rf ${DEST} fi mv /tools ${DEST} fi ldconfig exit $?