#!/bin/bash -e

PKG="turtlebot4_setup"

if [ -f /etc/turtlebot4/chrony.conf ]; then
    sudo cp /etc/turtlebot4/chrony.conf /etc/chrony/chrony.conf
fi
sudo service chrony restart
sudo systemctl enable webserver.service
sudo systemctl disable systemd-networkd-wait-online.service

# Remove old/new dpkg configs
sudo rm -f /etc/turtlebot4/*.dpkg-new
sudo rm -f /etc/turtlebot4/*.dpkg-old
sudo rm -f /etc/netplan/*.dpkg-new
sudo rm -f /etc/netplan/*.dpkg-old
sudo rm -f /etc/chrony/*.dpkg-new
sudo rm -f /etc/chrony/*.dpkg-old

#DEBHELPER#