mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-02-03 18:49:29 -05:00
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@896 f882894a-f735-0410-b71e-b25c423dba1c
31 lines
893 B
Bash
Executable file
31 lines
893 B
Bash
Executable file
#!/bin/bash
|
|
# Quick script to copy coreutil files into Nagios area
|
|
# Pass $1 as top level of coreutils source dir
|
|
# Expects to be run in the lib directory
|
|
|
|
function die { echo $1; exit 1; }
|
|
|
|
function copy_if_newer { [[ $1 -nt $2 ]] && cp $1 $2; }
|
|
|
|
coreutils_dir=$1
|
|
|
|
[[ -z $coreutils_dir ]] && die "Please specify coreutils directory"
|
|
|
|
cwd=`pwd`
|
|
|
|
[[ ${cwd##*/} != "lib" ]] && die "Must be run in lib directory"
|
|
|
|
# Get list of files from EXTRA_DIST in Makefile.am
|
|
# Need \\\ because the perl needs \\ but one is escaped
|
|
files="`perl -ne '$a=1 if s/^EXTRA_DIST\s*=\s*|libnagiosplug_a_SOURCES\s*=\s*//; $a=0 if /^\s*$/; if ($a==1) {s/\\\//; print $_}' Makefile.am`"
|
|
|
|
for i in $files ; do
|
|
if [[ -e $coreutils_dir/lib/$i ]] ; then
|
|
copy_if_newer $coreutils_dir/lib/$i ./$i
|
|
elif [[ -e $coreutils_dir/m4/$i ]] ; then
|
|
copy_if_newer $coreutils_dir/m4/$i ./$i
|
|
else
|
|
echo "Not found: $i"
|
|
fi
|
|
done
|
|
|