#!/bin/sh -efu
# Run efw service

. /bin/shell-config
. /bin/shell-var

EFW=/sbin/efw
NM_SYSCONFIG=/etc/sysconfig/NetworkManager
NM_RUN_EFW="$(shell_config_get "$NM_SYSCONFIG" NM_RUN_EFW)"

[ -n "$NM_RUN_EFW" ] && shell_var_is_yes "$NM_RUN_EFW" || exit 0
[ -x "$EFW" ] || exit 1

case "$2" in
	up) $EFW "$1" start	>/dev/null 2>&1 ;;
	down) $EFW "$1" stop >/dev/null 2>&1 ;;
esac
