initial commit of a *whole bunch* of old Egressive shell scripts, used to make many people redundant.
This commit is contained in:
commit
43e0f5b59e
329 changed files with 31937 additions and 0 deletions
5
egmaildetails/egmaildetails-cron
Normal file
5
egmaildetails/egmaildetails-cron
Normal file
|
@ -0,0 +1,5 @@
|
|||
#
|
||||
# rob@egressive.com 20071223
|
||||
#
|
||||
MAILTO=root
|
||||
*/5 * * * * root if [ -x /etc/egscripts/egmaildetails/egmaildetails.sh ]; then /etc/egscripts/egmaildetails/egmaildetails.sh; fi
|
84
egmaildetails/egmaildetails.sh
Executable file
84
egmaildetails/egmaildetails.sh
Executable file
|
@ -0,0 +1,84 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# created rob@egressive.com
|
||||
#
|
||||
# copies the ISPConfig user and host files to the
|
||||
# spam and virus filter host
|
||||
#
|
||||
#
|
||||
DEBUG="true"
|
||||
#
|
||||
EGMAILDETAILS_HOME="/etc/egscripts/egmaildetails"
|
||||
#
|
||||
LASTUSERS=$EGMAILDETAILS_HOME/last_users
|
||||
LASTHOSTS=$EGMAILDETAILS_HOME/last_hosts
|
||||
LASTACCESS=$EGMAILDETAILS_HOME/last_access
|
||||
#
|
||||
ISPCONFIGUSERS="/etc/postfix/virtusertable"
|
||||
ISPCONFIGHOSTS="/etc/postfix/local-host-names"
|
||||
#
|
||||
ACCESSFILE="/etc/postfix/access"
|
||||
#
|
||||
SERVERNAME="smithers"
|
||||
#
|
||||
REMOTESERVER="nelson.egressive.com"
|
||||
#REMOTESERVER="172.16.96.35"
|
||||
#
|
||||
LOGFILE="/tmp/egmaildetails.log"
|
||||
#
|
||||
TMP=/tmp
|
||||
# filename only - no path
|
||||
TRANSPORT="transport-$SERVERNAME"
|
||||
RECIPIENTS="recipients-$SERVERNAME"
|
||||
#
|
||||
SCPARGS=" "
|
||||
#
|
||||
if [ "$DEBUG"xxx == "truexxx" ]
|
||||
then
|
||||
echo `date` " Starting egmaildetails" >> $LOGFILE
|
||||
fi
|
||||
for i in $LASTUSERS $LASTHOSTS
|
||||
do
|
||||
if ! [ -f $i ]
|
||||
then
|
||||
touch $i
|
||||
fi
|
||||
done
|
||||
#
|
||||
if [ "$ISPCONFIGUSERS" -nt "$LASTUSERS" ]
|
||||
then
|
||||
awk \
|
||||
'! /^#/ {print $1 "\t\tOK" }' \
|
||||
/etc/postfix/virtusertable > $TMP/$RECIPIENTS
|
||||
scp $SCPARGS $TMP/$RECIPIENTS $REMOTESERVER:/etc/postfix/
|
||||
ssh $REMOTESERVER "postmap /etc/postfix/$RECIPIENTS"
|
||||
ssh $REMOTESERVER "postfix reload"
|
||||
# rm $TMP/$RECIPIENTS > /dev/null 2>&1
|
||||
touch $LASTUSERS
|
||||
fi
|
||||
if [ "$ISPCONFIGHOSTS" -nt "$LASTHOSTS" ]
|
||||
then
|
||||
awk \
|
||||
'! /^#/ && !/^localhost/ {print $0 "\t\tsmtp:[172.16.96.31]"}' \
|
||||
$ISPCONFIGHOSTS > $TMP/$TRANSPORT
|
||||
scp $SCPARGS $TMP/$TRANSPORT $REMOTESERVER:/etc/postfix/
|
||||
# make sure the local sites file has the right servername
|
||||
scp $SCPARGS $ISPCONFIGHOSTS $REMOTESERVER:$ISPCONFIGHOSTS-$SERVERNAME
|
||||
ssh $REMOTESERVER "postmap /etc/postfix/$TRANSPORT"
|
||||
ssh $REMOTESERVER "postfix reload"
|
||||
# rm $TMP/$TRANSPORT
|
||||
touch $LASTHOSTS
|
||||
fi
|
||||
if [ "$ACCESSFILE" -nt "$LASTACCESS" ]
|
||||
then
|
||||
scp $SCPARGS $ACCESSFILE $REMOTESERVER:$ACCESSFILE-$SERVERNAME
|
||||
ssh $REMOTESERVER "postmap $ACCESSFILE-$SERVERNAME"
|
||||
ssh $REMOTESERVER "postfix reload"
|
||||
touch $LASTACCESS
|
||||
true
|
||||
fi
|
||||
if [ "$DEBUG"xxx == "truexxx" ]
|
||||
then
|
||||
echo `date` "Finishing egmaildetails" >> $LOGFILE
|
||||
fi
|
||||
#
|
0
egmaildetails/last_access
Normal file
0
egmaildetails/last_access
Normal file
0
egmaildetails/last_hosts
Normal file
0
egmaildetails/last_hosts
Normal file
0
egmaildetails/last_users
Normal file
0
egmaildetails/last_users
Normal file
Loading…
Add table
Add a link
Reference in a new issue