#!/bin/bash
if ping -c1 -w2 192.168.1.1 &> /dev/null; then
echo 'king is GOOD'
elif grep "king" ~/maintenance.txt &> /dev/null; then
echo 'king is undergoing maintenance'
else
echo 'king is unexpectedly BAD!'
exit 1
fi
請問中間在幹嘛 這程式應該是在測可上網就顯示good
沒上網就顯示bad吧?!
中間我不會用 請問交一下我~~