This commit is contained in:
spiritlhl 2023-08-11 02:22:29 +00:00
parent bb966602e1
commit 46d7f8839a
2 changed files with 17 additions and 14 deletions

View file

@ -251,13 +251,14 @@ 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 -- 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 -- chmod +x config.sh
# pct exec $CTID -- bash config.sh # pct exec $CTID -- bash config.sh
if [ -z "$ipv6_address" ] || [ -z "$ipv6_prefixlen" ] || [ -z "$ipv6_gateway" ] || [ "$ipv6_prefixlen" -gt 112 ]; then
: # if [ -z "$ipv6_address" ] || [ -z "$ipv6_prefixlen" ] || [ -z "$ipv6_gateway" ] || [ "$ipv6_prefixlen" -gt 112 ]; then
else # :
sleep 3 # else
pct exec $CTID -- systemctl restart networking # sleep 3
pct reboot $CTID # pct exec $CTID -- systemctl restart networking
fi # pct reboot $CTID
# fi
iptables -t nat -A PREROUTING -p tcp --dport ${sshn} -j DNAT --to-destination ${user_ip}:22 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 iptables -t nat -A PREROUTING -p tcp -m tcp --dport ${web1_port} -j DNAT --to-destination ${user_ip}:80

View file

@ -238,13 +238,15 @@ 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 -- 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 -- chmod +x config.sh
# pct exec $CTID -- bash config.sh # pct exec $CTID -- bash config.sh
if [ -z "$ipv6_address" ] || [ -z "$ipv6_prefixlen" ] || [ -z "$ipv6_gateway" ] || [ "$ipv6_prefixlen" -gt 112 ]; then
: # if [ -z "$ipv6_address" ] || [ -z "$ipv6_prefixlen" ] || [ -z "$ipv6_gateway" ] || [ "$ipv6_prefixlen" -gt 112 ]; then
else # :
sleep 3 # else
pct exec $CTID -- systemctl restart networking # sleep 3
pct reboot $CTID # pct exec $CTID -- systemctl restart networking
fi # pct reboot $CTID
# fi
echo "$CTID $password $core $memory $disk $system_ori $storage $ipv6_address" >> "ct${CTID}" echo "$CTID $password $core $memory $disk $system_ori $storage $ipv6_address" >> "ct${CTID}"
# 容器的相关信息将会存储到对应的容器的NOTE中可在WEB端查看 # 容器的相关信息将会存储到对应的容器的NOTE中可在WEB端查看
data=$(echo " CTID root密码-password CPU核数-CPU 内存-memory 硬盘-disk 系统-system 存储盘-storage 外网IPV6-ipv6") data=$(echo " CTID root密码-password CPU核数-CPU 内存-memory 硬盘-disk 系统-system 存储盘-storage 外网IPV6-ipv6")