optimize ip info

This commit is contained in:
mercury
2023-04-08 00:53:23 +04:00
parent 7c6021c396
commit 06ca54756c
3 changed files with 13 additions and 11 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
export IP=$(curl https://ipinfo.io/ip)
rm /ssh/key*
ssh-keygen -m PEM -t rsa -f /ssh/key -N ''
openssl req -newkey rsa:2048 -sha256 -nodes -x509 -days 365 -keyout /certs/self_private -out /certs/self_public -subj "/C=NN/ST=N/L=N/O=N/CN=$(curl https://ipinfo.io/ip)"
openssl req -newkey rsa:2048 -sha256 -nodes -x509 -days 365 -keyout /certs/self_private -out /certs/self_public -subj "/C=NN/ST=N/L=N/O=N/CN=$IP"
php init.php
unitd --log /logs/unit_error
curl -X PUT --data-binary @/config/unit.json --unix-socket /var/run/control.unit.sock http://localhost/config