blob: f057d4eef09584edf974dbc3e5b2c8da70e4807c [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001#! /bin/sh
2# Copyright 2020 Garmin Ltd. or its subsidiaries
3#
4# SPDX-License-Identifier: GPL-2.0
5#
6# Attempts to find and exec the host qemu-bridge-helper program
7
8# If the QEMU_BRIDGE_HELPER variable is set by the user, exec it.
9if [ -n "$QEMU_BRIDGE_HELPER" ]; then
10 exec "$QEMU_BRIDGE_HELPER" "$@"
11fi
12
13# Search common paths for the helper program
14BN="qemu-bridge-helper"
15PATHS="/usr/libexec/ /usr/lib/qemu/"
16
17for p in $PATHS; do
18 if [ -e "$p/$BN" ]; then
19 exec "$p/$BN" "$@"
20 fi
21done
22
23echo "$BN not found!" > /dev/stderr
24exit 1
25