-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrestart.sh
More file actions
22 lines (16 loc) · 816 Bytes
/
restart.sh
File metadata and controls
22 lines (16 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
DOMAIN="www.mutliplayertierlist.com" # Your domain
EMAIL="Lubba64@gmail.com" # For Let's Encrypt
CERT_DIR="$HOME/multiplayer-tierlist/private" # Where your server expects certs
# ============================
echo "[+] Stopping custom web server..."
./server_control.sh stop
echo "[+] Force-renewing certificate for $DOMAIN..."
certbot certonly --standalone --non-interactive --agree-tos --email "$EMAIL" -d "$DOMAIN" --force-renewal
echo "[+] Moving certs to $CERT_DIR..."
mkdir -p "$CERT_DIR"
cp "/etc/letsencrypt/live/$DOMAIN/fullchain.pem" "$CERT_DIR/cert.pem"
cp "/etc/letsencrypt/live/$DOMAIN/privkey.pem" "$CERT_DIR/key.pem"
echo "[+] Restarting custom web server..."
./server_control.sh start
echo "[✅] DONE! Certs renewed and moved to $CERT_DIR"