#!/bin/bash

if [[ "$1" -eq 1 ]]; then
  # This is an upgrade.
  exit 0
fi

# remove the user and home dir
# /usr/sbin/userdel -r -f consul 2>/dev/null || true
rm -rf /var/lib/consul

# daemon-reload
if [ -x "/bin/systemctl" ]; then
  /bin/systemctl daemon-reload
fi
