#!/bin/sh

[ -n "$IPKG_INSTROOT" ] && return 0

conf_file="/etc/config/attendedsysupgrade"

if [ ! -e "$conf_file" ]; then
. /etc/uci-defaults/50-attendedsysupgrade
fi

if [ -z "$(uci get attendedsysupgrade.owut 2> /dev/null)" ]; then
cat <<CONF >> "$conf_file"
# Example configuration for 'owut'.  The option names are the same
# as those used on the command line, with all '-' dashes replaced by
# '_' underscores.  Use 'owut --help' to see more.

config owut 'owut'
#	option verbosity         0
#	option keep              true
#	option init_script      '/root/data/my-init-script.sh'
#	option image            '/tmp/my-firmware-img.bin'
#	option rootfs_size       256
#	option pre_install      '/etc/owut.d/pre-install.sh'
#	option poll_interval     10000  # In milliseconds
#	list   ignored_defaults 'kmod-drm-i915'
#	list   ignored_defaults 'kmod-dwmac-intel'

CONF
echo "Please see owut section of $conf_file for example options."
fi
