#!/bin/sh -x # ver.20120623-01 . /home/web/default/petar.company/sudo_cmd/tools.cfg ### Inizio batch cd ${QUEUEDIR} ### Cancellazione utenti, if any # if [ -f rmuser.queue ]; then # echo "Parsing rmuser.queue file
" # chown root:wheel rmuser.queue # chmod 600 rmuser.queue # rmuser -v -y -f rmuser.queue # rm rmuser.queue #fi ### Cancellazione utenti if [ -f rmuser.queue ]; then echo "Found some user(s) to delete" while read utente; do echo " - Deleting ${utente} ... " /usr/sbin/pw userdel ${utente} -r rm -r ${HOMEDIR}/${utente} rm -r /var/mail/${utente} done < rmuser.queue rm rmuser.queue fi ### Creazione local-host-names cat ${LHN_SRC_TOP} ${LHN_SRC_FILE} > ${LHN_DST_FILE} ### Creazione master.passwd e Backup /usr/sbin/pwd_mkdb ${MAIL_SRC_FILE} ### Creazione virtusertable cat ${VIRT_SRC_TOP} ${VIRT_SRC_FILE} > ${VIRT_DST_FILE} cp ${VIRT_DST_FILE} /etc/mail/virtusertable cp ${VIRT_DST_FILE} ${VIRT_DST_ARCH} ### Fixing permessi cd ${HOMEDIR} for dir in *; do chown -R $dir $dir done ### Restart servizi cd /etc/mail make make stop make start