#!/bin/sh
# Wrapper: run the VpnMesh CLI binary from its install location.
set -eu

VPNMESH_BIN="/usr/lib/vpnmesh/vpnmesh"

if [ ! -e "$VPNMESH_BIN" ]; then
	echo "vpnmesh wrapper error: binary not found at $VPNMESH_BIN" >&2
	exit 127
fi

if [ ! -x "$VPNMESH_BIN" ]; then
	echo "vpnmesh wrapper error: binary is not executable: $VPNMESH_BIN" >&2
	exit 126
fi

exec "$VPNMESH_BIN" "$@"
