diff --git a/build-aux/snap/snapcraft.yaml b/build-aux/snap/snapcraft.yaml index 458ee62..f2c7547 100644 --- a/build-aux/snap/snapcraft.yaml +++ b/build-aux/snap/snapcraft.yaml @@ -42,7 +42,7 @@ apps: parts: ddclient: plugin: autotools - source: https://github.com/ddclient/ddclient.git + source: . autotools-configure-parameters: - --prefix=/usr - --sysconfdir=/etc/ddclient diff --git a/ddclient-snap-wrapper b/ddclient-snap-wrapper new file mode 100755 index 0000000..4f520b3 --- /dev/null +++ b/ddclient-snap-wrapper @@ -0,0 +1,24 @@ +#!/bin/bash + +# handle --help as special case + +config_file="${SNAP_COMMON}/etc/ddclient/ddclient.conf" + +print_help() { + echo -e "${SNAP_NAME} uses config file as way to configuration." + echo -e "Edit ${config_file} with desired configuration." + echo -e "Once config is ready, enable service with:" + echo -e "\t$ snap start --enable ${SNAP_NAME}.daemon" +} + +if [ "${1}" = "--help" ]; then + print_help +else + mkdir -p -m 700 /tmp/cache + "${SNAP}"/usr/bin/ddclient \ + -file "${config_file}" \ + -cache /tmp/cache/ddclient.cache \ + -pid /tmp/ddclient.pid \ + --foreground + ${@} +fi