mkdir -p $(DESTDIR)$(datadir)
cp -a $(datas) $(DESTDIR)$(datadir)/
mkdir -p $(DESTDIR)$(bindir)
- install -m 755 vircmd waitfor $(DESTDIR)$(bindir)
+ install -m 755 vircmd $(DESTDIR)$(bindir)
install -m 755 autocluster.hack $(DESTDIR)$(bindir)/autocluster
debian/changelog: debian/changelog.in Makefile .git/refs/heads/master
Autocluster creates virtual machines that use libvirt to run under
KVM. This means that you will need to install both KVM and
- libvirt on your host machine. Expect is used by the "waitfor"
- script and should be available for installation form your
+ libvirt on your host machine. Expect is used by the waitfor()
+ function and should be available for installation from your
distribution.
For various distros:
echo ""
}
+waitfor ()
+{
+ local file="$1"
+ local msg="$2"
+ local timeout="$3"
+
+ local tmpfile=$(mktemp)
+
+ cat <<EOF >"$tmpfile"
+spawn tail -n 10000 -f $file
+expect -timeout $timeout -re "$msg"
+EOF
+
+ export LANG=C
+ expect "$tmpfile"
+ rm -f "$tmpfile"
+
+ if ! grep -E "$msg" "$file" > /dev/null; then
+ echo "Failed to find \"$msg\" in \"$file\""
+ return 1
+ fi
+
+ return 0
+}
+
###############################
# Indirectly call a function named by ${1}_${2}
%{_prefix}/share/autocluster/*
%{_bindir}/autocluster
%{_bindir}/vircmd
-%{_bindir}/waitfor
+++ /dev/null
-#!/bin/bash
-# wait for a string to appear at the end of file
-# tridge@samba.org July 2008
-
-[ $# -lt 3 ] && {
- cat <<EOF
-Usage: waitfor FILE MESSAGE TIMEOUT
-EOF
-exit 1
-}
-
-file="$1"
-msg="$2"
-timeout="$3"
-
-tmpfile=`mktemp`
-
-cat <<EOF > $tmpfile
-spawn tail -n 10000 -f $file
-expect -timeout $timeout "$msg"
-EOF
-
-expect $tmpfile
-rm -f $tmpfile
-
-if ! grep "$msg" $file > /dev/null; then
- echo "Failed to find \"$msg\" in $file"
- exit 1
-fi
-exit 0
+++ /dev/null
-#!/bin/bash
-# wait for a string to appear at the end of file
-# tridge@samba.org July 2008
-
-[ $# -lt 3 ] && {
- cat <<EOF
-Usage: waitfor FILE MESSAGE TIMEOUT
-EOF
-exit 1
-}
-
-file="$1"
-msg="$2"
-timeout="$3"
-
-tmpfile=`mktemp`
-
-cat <<EOF > $tmpfile
-spawn tail -n 10000 -f $file
-expect -timeout $timeout -re "$msg"
-EOF
-
-export LANG=C
-expect $tmpfile
-rm -f $tmpfile
-
-if ! grep -E "$msg" $file > /dev/null; then
- echo "Failed to find \"$msg\" in $file"
- exit 1
-fi
-exit 0