From 10e5fb2b9b2f27c83b3e5a1d048b158d5cf42a43 Mon Sep 17 00:00:00 2001 From: Yves-Alexis Perez Date: Fri, 26 Apr 2013 14:57:47 +0200 Subject: Imported Upstream version 5.0.3 --- .../hosts/default/etc/ld.so.conf.d/strongswan.conf | 1 + testing/hosts/default/usr/local/bin/expect-file | 29 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 testing/hosts/default/etc/ld.so.conf.d/strongswan.conf create mode 100755 testing/hosts/default/usr/local/bin/expect-file (limited to 'testing/hosts/default') diff --git a/testing/hosts/default/etc/ld.so.conf.d/strongswan.conf b/testing/hosts/default/etc/ld.so.conf.d/strongswan.conf new file mode 100644 index 000000000..8648d0185 --- /dev/null +++ b/testing/hosts/default/etc/ld.so.conf.d/strongswan.conf @@ -0,0 +1 @@ +/usr/local/lib/ipsec diff --git a/testing/hosts/default/usr/local/bin/expect-file b/testing/hosts/default/usr/local/bin/expect-file new file mode 100755 index 000000000..6921b6638 --- /dev/null +++ b/testing/hosts/default/usr/local/bin/expect-file @@ -0,0 +1,29 @@ +#!/bin/bash +# +# Wait until a given file appears +# +# Params: +# $1 - filename +# $2 - maximum time to wait in seconds, default is 5 seconds + +if [[ $# -lt 1 || $# -gt 2 ]] +then + echo "invalid arguments" + exit 1 +fi + +secs=$2 +[ ! $secs ] && secs=5 + +let steps=$secs*10 +for i in `seq 1 $steps` +do + # -f does not work for special files (e.g. UNIX domain sockets), use ls + # instead + ls $1 >/dev/null 2>&1 + [ $? -eq 0 ] && exit 0 + sleep 0.1 +done + +echo "File '$1' not available after $secs second(s)" +exit 1 -- cgit v1.2.3