Initial commit
This commit is contained in:
commit
529efd53a1
140 changed files with 10310 additions and 0 deletions
59
sudo_cmd/.off/mail-sync.sh
Executable file
59
sudo_cmd/.off/mail-sync.sh
Executable file
|
|
@ -0,0 +1,59 @@
|
|||
#!/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<BR>"
|
||||
# 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 "<b>Found some user(s) to delete</b>"
|
||||
|
||||
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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue