2023.08.09

This commit is contained in:
spiritlhl 2023-08-09 14:48:23 +00:00
parent 0dafe12f69
commit d18bbd223a
4 changed files with 15 additions and 2 deletions

View file

@ -17,6 +17,7 @@
- 判断是否有IPV6网络如果没有则宿主机就不添加对应的V6的DNS
- 判断是否有IPV6网络如果没有则开设的虚拟机和容器就不添加对应的V6的DNS
- 修复带IPV6环境的容器设置ssh时需要重启容器才能保证容器内网络联通的问题自动判断是否需要自重启容器
[更新日志](CHANGELOG.md)

View file

@ -251,6 +251,12 @@ pct exec $CTID -- bash ssh.sh
# pct exec $CTID -- curl -L ${cdn_success_url}https://raw.githubusercontent.com/spiritLHLS/lxc/main/config.sh -o config.sh
# pct exec $CTID -- chmod +x config.sh
# pct exec $CTID -- bash config.sh
if [ -z "$ipv6_address" ] || [ -z "$ipv6_prefixlen" ] || [ -z "$ipv6_gateway" ] || [ "$ipv6_prefixlen" -gt 112 ]; then
:
else
pct exec $CTID -- systemctl restart networking
pct exec $CTID -- reboot
fi
iptables -t nat -A PREROUTING -p tcp --dport ${sshn} -j DNAT --to-destination ${user_ip}:22
iptables -t nat -A PREROUTING -p tcp -m tcp --dport ${web1_port} -j DNAT --to-destination ${user_ip}:80

View file

@ -238,6 +238,12 @@ pct exec $CTID -- bash ssh.sh
# pct exec $CTID -- curl -L ${cdn_success_url}https://raw.githubusercontent.com/spiritLHLS/lxc/main/config.sh -o config.sh
# pct exec $CTID -- chmod +x config.sh
# pct exec $CTID -- bash config.sh
if [ -z "$ipv6_address" ] || [ -z "$ipv6_prefixlen" ] || [ -z "$ipv6_gateway" ] || [ "$ipv6_prefixlen" -gt 112 ]; then
:
else
pct exec $CTID -- systemctl restart networking
pct exec $CTID -- reboot
fi
echo "$CTID $password $core $memory $disk $system_ori $storage $ipv6_address" >> "ct${CTID}"
# 容器的相关信息将会存储到对应的容器的NOTE中可在WEB端查看
data=$(echo " CTID root密码-password CPU核数-CPU 内存-memory 硬盘-disk 系统-system 存储盘-storage 外网IPV6-ipv6")

View file

@ -1,7 +1,7 @@
#!/bin/bash
# from
# https://github.com/spiritLHLS/pve
# 2023.08.04
# 2023.08.09
if [ -f "/etc/resolv.conf" ]
then
@ -180,5 +180,5 @@ service ssh restart
service sshd restart
systemctl restart sshd
systemctl restart ssh
sed -i 's/.*precedence ::ffff:0:0\/96.*/precedence ::ffff:0:0\/96 100/g' /etc/gai.conf && systemctl restart networking
sed -i 's/.*precedence ::ffff:0:0\/96.*/precedence ::ffff:0:0\/96 100/g' /etc/gai.conf
rm -rf "$0"