#!/bin/bash # Create webroot and web server for certbot renewal me=$(basename "$0") dir=/var/lib/letsencrypt/tmpwww ips="1.2.3.4 10.11.12.13" ## <-- IPs to be used for validation mkdir -p "$dir" cd "$dir" declare -a pids for ip in $ips; do logger -t "$me" "Starting server on $ip in $dir" nohup python3 -m http.server --bind $ip 80 &>/dev/null & pid=$! pids+=($pid) echo "$pid" > "$dir/certbot-webroot-$$-$pid.pid" done