#! /bin/sh
# Copyright (C) 2020-2021 NVIDIA Corporation. ALL RIGHTS RESERVED.
# Copyright 2017 Cumulus Networks, Inc.  All rights reserved

# Helper script for stopssh.service
# systemd does not terminate ssh sessions during reboot, and
# we want them to terminate cleanly, rather than fail after TCP times out.

PATH=/bin/:/usr/bin:$PATH

killall -q sshd
if [ $? -ne 0 ]; then
  echo SSH services already stopped prior to reboot
  exit 0
fi
sleep 1
killall -q -KILL sshd || true
