Skip to content

Instantly share code, notes, and snippets.

View Ansen's full-sized avatar
🐶
Working all day

An Ansen

🐶
Working all day
View GitHub Profile
#!/bin/bash
# Author: An Shen
# Date: 2023-01-30
. /etc/profile
function log(){
echo "[$(date +'%Y-%m-%d %H:%M:%S')] - $1"
}
@Ansen
Ansen / network-check.sh
Last active February 19, 2024 03:27
Automatically restart the device when the network is unavailabled
#!/bin/bash
. /etc/profile > /dev/null 2>&1
# PUB_DNS='1.1.1.1'
# CHINA ONLY
PUB_DNS='223.5.5.5'
# percentage
REBOOT_THRESHOLD=80