blob: 671119355b13ebb31c55e2506dae0447b75d03d3 (
plain)
- #! /usr/bin/cfengine -qf
- control:
- OutputPrefix = ("${cf_prefix}")
- actionsequence = (
- editfiles
- shellcommands
- processes
- )
- AddInstallable = ( amavis_reload )
- EditfileSize = ( 70000 )
- editfiles:
- any::
- { /etc/amavis/amavisd.conf
- DefineClasses "amavis_reload"
- #
- # $mydomain = '$(maildomain)';
- #
- WarnIfNoLineMatching "^[[:blank:]]*\$mydomain[[:blank:]].*"
- LocateLineMatching "^[[:blank:]]*\$mydomain[[:blank:]].*"
- BeginGroupIfNoLineMatching "^[[:blank:]]*\$mydomain[[:blank:]]*=[[:blank:]]*$(maildomain)[[:blank:]]*"
- ReplaceLineWith "$mydomain = $(maildomain) # Edited by cfengine"
- EndGroup
- #
- # Make space for cfengine hacks near EOF
- #
- ResetSearch "1"
- BeginGroupIfNoSuchLine "# BEGIN CFENGINE"
- WarnIfNoLineMatching "^1;[[:blank:]]*# insure a defined return$"
- BeginGroupIfNoLineMatching "^# BEGIN CFENGINE$"
- LocateLineMatching "^1;[[:blank:]]*# insure a defined return$"
- IncrementPointer "-1"
- InsertLine ""
- InsertLine "# BEGIN CFENGINE"
- InsertLine "# END CFENGINE"
- InsertLine ""
- EndGroup
- EndGroup
- #
- # my $config_file_addon="/etc/local-COMMON/amavis/amavisd.conf.addon";
- # -f $config_file_addon or die "Cannot find config file $config_file_addon";
- # do $config_file_addon or die "Error in config file $config_file_addon: $@";
- #
- ResetSearch "1"
- AbortAtLineMatching "^# END CFENGINE$"
- LocateLineMatching "^# BEGIN CFENGINE$"
- BeginGroupIfNoLineMatching '^[[:blank:]]*my $config_file_addon[[:blank:]]*=[[:blank:]]*"/etc/local-COMMON/amavis/amavisd.conf.addon";'
- InsertLine 'my $config_file_addon="/etc/local-COMMON/amavis/amavisd.conf.addon";'
- InsertLine '-f $config_file_addon or die "Cannot find config file $config_file_addon";'
- InsertLine 'do $config_file_addon or die "Error in config file $config_file_addon: $@";'
- EndGroup
- UnsetAbort "^# END CFENGINE$"
- }
- processes:
- "amavisd" restart "/etc/init.d/amavis restart"
- shellcommands:
- amavis_reload::
- "/etc/init.d/amavis force-reload"
|