Bash script for checking telnet service status


cat monitor.sh 
#!/bin/bash
source /etc/profile
cd /home/koala/Vagrant/windows-server-2019
(echo > /dev/tcp/192.168.178.220/23) > /dev/null 2>&1
if [ $? -ne 0 ]; then
  vagrant halt
  vagrant up
fi