2018-12-05 09:33:03 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
SUDO=
|
|
|
|
while [ "$#" -gt 0 ]; do
|
|
|
|
key="$1"
|
|
|
|
case "$key" in
|
|
|
|
SUDO)
|
|
|
|
SUDO=sudo
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unknown argument: $key"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
# subshell so that we can cd without effecting the rest
|
|
|
|
(
|
|
|
|
set +e
|
|
|
|
cd ./shared;
|
2019-02-24 09:45:26 +00:00
|
|
|
$SUDO sh -x ./test.sh;
|
2018-12-05 09:33:03 +00:00
|
|
|
echo $?;
|
2023-01-16 06:54:03 +00:00
|
|
|
) 2>&1 | tee shared/output.txt
|
|
|
|
if [ "$(cat shared/exitstatus.txt)" -ne 0 ]; then
|
2018-12-05 09:33:03 +00:00
|
|
|
echo "test.sh failed"
|
|
|
|
exit 1
|
|
|
|
fi
|