#!/bin/bash
### BEGIN BOOT SCRIPT INFO
#Long-Name: uARM
### END BOOT SCRIPT INFO
### BEGIN BOOT SCRIPT INSTALLATION DEFAULTS
#Launch-Mode: gui-only
### END BOOT SCRIPT INSTALLATION DEFAULTS
#
#This script uses a standard run scriptlet called RUN_UARM, which should
#end with a call to run_uarm (which passes its options to uarm-${UARM_DEVICE}).
#The scriptlet must set $UARM_DEVICE to the device name suffix of the uARM
#binary.

. bootscriptfunctions.sh

SCRIPT_ARGS=("$@")

run_uarm()
{
	if [ ! "${UARM_DEVICE}" ]
	then
		echo "UARM_DEVICE unset" >&2
		exit 1
	fi
	exec "uARM-${UARM_DEVICE}" \
		"${SCRIPT_ARGS[@]}" \
		"$@"
}

call_run_scriptlet uarm
