#!/bin/bash

# Store applied defaults here
touch /var/lib/misc/applied-snapd-defaults

# Disable automatic snapshots when removing snaps
# Depending on the snap's data directory contents this might take a *long* time
# For more information about snapshots visit: https://snapcraft.io/docs/snapshots
if ! grep -q "snapshots.automatic.retention=no" /var/lib/misc/applied-snapd-defaults; then
    snap set system snapshots.automatic.retention=no
    echo "snapshots.automatic.retention=no" >> /var/lib/misc/applied-snapd-defaults
fi

exit 0
