websoft9/apps/roles/fastpanel/templates/init_without_docker.sh

13 lines
516 B
Bash
Raw Normal View History

2022-09-07 09:24:37 +08:00
#!/bin/bash
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
2022-09-07 09:24:00 +08:00
newpassword=$1
2022-09-21 11:52:13 +08:00
# echo $newpassword |passwd --stdin fastuser
echo "fastuser:$newpassword" | chpasswd
2022-09-07 16:23:51 +08:00
2022-09-07 16:39:55 +08:00
sed -i '/172.17.0.1/d' /etc/nginx/conf.d/parking.conf
2022-09-07 16:23:51 +08:00
internal_ip=$(ip addr show dev eth0|grep inet |grep eth0|cut -d/ -f1|cut -d" " -f6)
2022-09-07 16:42:08 +08:00
old_ip=$(cat /etc/nginx/conf.d/parking.conf |grep default_server|grep ssl |cut -d: -f1|cut -d" " -f6)
2022-09-07 16:23:51 +08:00
sed -i "s/$old_ip/$internal_ip/g" /etc/nginx/conf.d/parking.conf
systemctl restart nginx