diff --git a/snap/hooks/post-refresh b/snap/hooks/post-refresh new file mode 100644 index 00000000..bd727723 --- /dev/null +++ b/snap/hooks/post-refresh @@ -0,0 +1,5 @@ +#!/bin/sh -e + +if [ -z "$( ls -A '/var/lib/landscape/client' )" ]; then + cp -r /var/lib/landscape/old/client/. /var/lib/landscape/client/ +fi diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 36bc3572..1d6c8e4b 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -33,7 +33,7 @@ slots: annotations: interface: content write: - - $SNAP_DATA/var/lib/landscape/client/annotations.d + - $SNAP_COMMON/var/lib/landscape/client/annotations.d apps: landscape-client: @@ -63,6 +63,8 @@ layout: /etc/landscape-client.conf: bind-file: $SNAP_COMMON/etc/landscape-client.conf /var/lib/landscape/client: + bind: $SNAP_COMMON/var/lib/landscape/client + /var/lib/landscape/old/client: bind: $SNAP_DATA/var/lib/landscape/client /var/log/landscape: bind: $SNAP_DATA/var/log/landscape