Skip to content

Commit

Permalink
restart overtls service every day
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrlive committed Sep 7, 2024
1 parent 584ea1d commit 428f4d4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions install/overtls-install-musl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,13 @@ EOF
judge "cron scheduled task update"
}

function cron_random_restart_overtls_svc() {
local random_hour=$(od -An -N1 -i /dev/urandom | awk '{print $1 % 24}')
local random_minute=$(od -An -N1 -i /dev/urandom | awk '{print $1 % 60}')

(crontab -l; echo "${random_minute} ${random_hour} * * * systemctl restart overtls") | crontab -
}

function nginx_web_server_config_end() {
rm -rf ${nginx_conf_file}
cat > ${nginx_conf_file} <<EOF
Expand Down Expand Up @@ -733,6 +740,8 @@ function install_overtls_remote_server() {
exit 1
fi

cron_random_restart_overtls_svc

echo
echo "======== config.json ========"
echo
Expand Down

0 comments on commit 428f4d4

Please sign in to comment.