initial re-commit to wipe commit histoy due to public repo

This commit is contained in:
2024-07-06 21:10:44 +00:00
commit a20ba3505a
17 changed files with 465 additions and 0 deletions

24
other/haphazard_reboot.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
# Random Reboot after minimum uptime script
# Flat 1 in $CHANCE chance of reboot -- crontab freq matters.
# Expected per hour run
# 1000000 is one day
# chance 192 is average 8 day
MIN_UT=4000000
CHANCE=192
UPTIMEVAL=$(uptime | cut -f 2 -d ' ' | sed "s/://g")
echo "Flat uptime:$UPTIMEVAL"
#UPTIMEVAL=220000
if [[ $UPTIMEVAL -gt $MIN_UT ]] ; then
echo "gt success, now random"
if [[ $(( $RANDOM % 48 )) == 0 ]] ; then
echo "random success"
reboot
fi
fi