This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cfg_parser() { | |
IFS=$'\n' && ini=( $(<$1) ) # convert to line-array | |
ini=( ${ini[*]//;*/} ) # remove comments ; | |
ini=( ${ini[*]//\#*/} ) # remove comments # | |
ini=( ${ini[*]/#[/\}$'\n'cfg.section.} ) # set section prefix | |
ini=( ${ini[*]/%]/ \(} ) # convert text2function (1) | |
ini=( ${ini[*]/=/=\( } ) # convert item to array | |
ini=( ${ini[*]/%/ \)} ) # close array parenthesis | |
ini=( ${ini[*]/%\( \)/\(\) \{} ) # convert text2function (2) | |
ini=( ${ini[*]/%\} \)/\}} ) # remove extra parenthesis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task :synctopbuilder do | |
tmp_freedhcp_index="tmp/freedhcp-server-index" | |
rm_rf freedhcpsrc + '/' + tmp_freedhcp_index | |
sh "git --work-tree=#{freedhcpsrc} --git-dir=#{freedhcpsrc}/.git " + | |
"checkout-index -a -f --prefix=#{tmp_freedhcp_index}/" | |
sh "rsync --delete -r #{freedhcpsrc}/#{tmp_freedhcp_index} #{srcforpbuilder}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while true | |
do | |
tput clear | |
date | |
/usr/local/icinga/bin/icinga -v /etc/nagios3/icinga.cfg | grep -B 10 'Total Errors:' | |
sleep 30 | |
done |
NewerOlder