Fix postfix steps (missing extend for postfixdetailed, missing dependencies for postfix-queues)
This commit is contained in:
30
seqs/snmp.sh
30
seqs/snmp.sh
@@ -107,7 +107,7 @@ step_20() {
|
|||||||
# VCHI initialization failed fix
|
# VCHI initialization failed fix
|
||||||
exe usermod -aG video ${toolSysUser}
|
exe usermod -aG video ${toolSysUser}
|
||||||
|
|
||||||
addConf -c "$rpiSudoersContent" "$rpiSudoersLoc"
|
addConf -s "$rpiSudoersContent" "$rpiSudoersLoc"
|
||||||
|
|
||||||
exe service snmpd restart
|
exe service snmpd restart
|
||||||
}
|
}
|
||||||
@@ -281,7 +281,7 @@ step_32() {
|
|||||||
}
|
}
|
||||||
postfixDeps="pflogsumm"
|
postfixDeps="pflogsumm"
|
||||||
|
|
||||||
step_33_info() { echo "Prepare cache folder for postfix details"; }
|
step_33_info() { echo "Prepare cache folder for postfixdetailed"; }
|
||||||
step_33() {
|
step_33() {
|
||||||
exe touch "$postfixCacheLoc"
|
exe touch "$postfixCacheLoc"
|
||||||
exe chown root:$toolSysUser "$postfixCacheLoc"
|
exe chown root:$toolSysUser "$postfixCacheLoc"
|
||||||
@@ -298,14 +298,24 @@ postfixCacheLoc="/var/cache/postfixdetailed"
|
|||||||
postfixScript="${toolConfigLoc}/postfixdetailed"
|
postfixScript="${toolConfigLoc}/postfixdetailed"
|
||||||
postfixQueuesExtendLoc="${toolConfigLoc}/postfix-queues"
|
postfixQueuesExtendLoc="${toolConfigLoc}/postfix-queues"
|
||||||
|
|
||||||
step_34_info() { echo "Create postfix extends (postfixdetailed and postfix-queues)"; }
|
step_34_info() { echo "Create sudoers file for postfix scripts"; }
|
||||||
step_34() {
|
step_34() {
|
||||||
|
addConf -s "$postfixSudoersContent" "$postfixSudoersLoc"
|
||||||
|
echo " [I] Changing ${postfixQueuesExtendLoc} to add sudo for qshape"
|
||||||
|
exe sed -i -E "s/\`qshape/\`sudo qshape/" "${postfixQueuesExtendLoc}"
|
||||||
|
echo " [W] Reboot may be required to make these changes active"
|
||||||
|
}
|
||||||
|
postfixSudoersLoc="/etc/sudoers.d/snmppostfix"
|
||||||
|
postfixSudoersContent="${toolSysUser} ALL=(ALL) NOPASSWD: /usr/sbin/qshape"
|
||||||
|
|
||||||
|
step_35_info() { echo "Create postfix extends (postfixdetailed and postfix-queues)"; }
|
||||||
|
step_35() {
|
||||||
checkExtend postfix-queues
|
checkExtend postfix-queues
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo " [I] Create postfix-queues extend"
|
echo " [I] Create postfix-queues extend"
|
||||||
addConf -a "extend mailq ${postfixQueuesExtendLoc}" "$toolConfig"
|
addConf -a "extend mailq ${postfixQueuesExtendLoc}" "$toolConfig"
|
||||||
fi
|
fi
|
||||||
checkExtend postfix-queues
|
checkExtend postfixdetailed
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo " [I] Create postfixdetailed extend"
|
echo " [I] Create postfixdetailed extend"
|
||||||
addConf -a "extend postfixdetailed ${postfixScript}" "$toolConfig"
|
addConf -a "extend postfixdetailed ${postfixScript}" "$toolConfig"
|
||||||
@@ -315,9 +325,9 @@ step_34() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#fail2ban
|
#fail2ban
|
||||||
step_36_info() { echo "Extend for fail2ban jail information"; }
|
step_37_info() { echo "Extend for fail2ban jail information"; }
|
||||||
step_36_alias() { ALIAS="fail2ban"; }
|
step_37_alias() { ALIAS="fail2ban"; }
|
||||||
step_36(){
|
step_37(){
|
||||||
local aptOpt=
|
local aptOpt=
|
||||||
if [ $QUIET -ne 0 ];then
|
if [ $QUIET -ne 0 ];then
|
||||||
aptOpt="-y"
|
aptOpt="-y"
|
||||||
@@ -341,8 +351,8 @@ step_36(){
|
|||||||
fail2banDeps="libjson-perl"
|
fail2banDeps="libjson-perl"
|
||||||
fail2banExtendLoc="${toolConfigLoc}/fail2ban"
|
fail2banExtendLoc="${toolConfigLoc}/fail2ban"
|
||||||
|
|
||||||
step_37_info() { echo "Create cron to update fail2ban cache"; }
|
step_38_info() { echo "Create cron to update fail2ban cache"; }
|
||||||
step_37() {
|
step_38() {
|
||||||
addConf -s "$fail2banCron" "$fail2banCronLoc"
|
addConf -s "$fail2banCron" "$fail2banCronLoc"
|
||||||
}
|
}
|
||||||
fail2banCronLoc="/etc/cron.d/fail2banCache"
|
fail2banCronLoc="/etc/cron.d/fail2banCache"
|
||||||
@@ -365,5 +375,5 @@ checkExtend() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
VERSION_SEQREV=10
|
VERSION_SEQREV=11
|
||||||
. /usr/local/bin/sequencer.sh
|
. /usr/local/bin/sequencer.sh
|
||||||
|
Reference in New Issue
Block a user