#!/bin/sh -e

DEFAULT_BAR="default"
DEFAULT_BAZ="default"
DEFAULT_PORT=8080

bar="$(snapctl get foo.bar)"
if [ -z "$bar" ]; then
    bar="$DEFAULT_BAR"
fi

baz="$(snapctl get foo.baz)"
if [ -z "$baz" ]; then
    baz="$DEFAULT_BAZ"
fi

port="$(snapctl get port)"
if [ -z "$port"]; then
    port="$DEFAULT_PORT"
fi

snapctl set foo.bar="$bar"
snapctl set foo.baz="$baz"
snapctl set port="$port"
