#!/bin/sh

set -e

echo "Start tailscaled service"
systemctl start tailscaled

if ! systemctl is-active -q tailscaled; then
    echo "the service tailscaled is not active"
    exit 1
fi

echo "Stop tailscaled service"
systemctl stop tailscaled

if systemctl is-active -q tailscaled; then
    echo "the service tailscaled is still active"
    exit 1
fi
