2008-10-03 19:06:28 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2008-11-03 20:35:40 +00:00
|
|
|
daemon=0
|
2008-11-20 18:32:42 +00:00
|
|
|
valgrind=""
|
2008-10-15 21:01:22 +00:00
|
|
|
|
|
|
|
# explicit -n/--norestart?
|
2008-11-20 18:32:42 +00:00
|
|
|
while [ $# -ge 1 ]; do
|
|
|
|
case $1 in
|
2008-10-15 21:01:22 +00:00
|
|
|
-n | --norestart )
|
2008-11-20 18:32:42 +00:00
|
|
|
daemon=1
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--valgrind )
|
|
|
|
valgrind="valgrind"
|
|
|
|
daemon=1
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
* )
|
|
|
|
break
|
|
|
|
esac
|
|
|
|
done
|
2008-10-15 21:01:22 +00:00
|
|
|
|
2008-10-03 19:33:26 +00:00
|
|
|
orig_args=$*
|
|
|
|
|
2008-10-15 21:01:22 +00:00
|
|
|
# implicit from any -d?
|
2008-10-03 19:33:26 +00:00
|
|
|
while [ $# -ge 1 ]; do
|
2008-10-15 21:01:22 +00:00
|
|
|
case $1 in
|
|
|
|
-d | --daemon )
|
|
|
|
daemon=1
|
|
|
|
esac
|
|
|
|
shift
|
2008-10-03 19:33:26 +00:00
|
|
|
done
|
|
|
|
|
2008-10-03 19:06:28 +00:00
|
|
|
while [ true ]; do
|
2008-11-20 18:32:42 +00:00
|
|
|
$valgrind $orig_args
|
2008-10-03 19:33:26 +00:00
|
|
|
[ $daemon -eq 1 ] && exit
|
2008-10-03 19:06:28 +00:00
|
|
|
done
|