blob: 1344fbed50440f5828343af8293188177275d4f9 [file] [edit]
#!/bin/sh -e
if [ "$1" = "configure" ] ; then
if [ ! -f /etc/default/instance_configs.cfg ]; then
cp -a "/usr/share/${DPKG_MAINTSCRIPT_PACKAGE}/instance_configs.cfg" /etc/default/
fi
if [ ! -f "/usr/bin/google_guest_compat_manager" ]; then
if [ -f "/etc/google-guest-agent/core-plugin-enabled" ] && [ ! -z $(grep "true" "/etc/google-guest-agent/core-plugin-enabled") ]; then
# If the guest agent is disabled because core plugin is enabled, then
# re-enable the guest agent. Otherwise it stays disabled post-upgrade.
systemctl enable 'google-guest-agent.service' > /dev/null || true
systemctl enable 'gce-workload-cert-refresh.timer' > /dev/null || true
fi
fi
# Disable and stop this service in favor of core plugin to be run on default.
systemctl disable 'google-guest-agent.service' > /dev/null || true
systemctl stop 'google-guest-agent.service' > /dev/null || true
fi
#DEBHELPER#