Check vncport file exits on CPVM before attempting to add rules

This commit is contained in:
nvazquez 2022-08-18 00:31:39 -03:00
parent d0470d8cc4
commit e6089b80c4
No known key found for this signature in database
GPG Key ID: 656E1BCC8CB54F84

View File

@ -44,10 +44,13 @@ setup_console_proxy() {
setup_sshd $ETH0_IP "eth0"
fi
vncport=`cat /root/vncport`
log_it "vncport read: ${vncport}"
sed -i 's/8080/${vncport}/' /etc/iptables/rules.v4
log_it "vnc port ${vncport} rule applied"
if [ -f /root/vncport ]
then
vncport=`cat /root/vncport`
log_it "vncport read: ${vncport}"
sed -i 's/8080/${vncport}/' /etc/iptables/rules.v4
log_it "vnc port ${vncport} rule applied"
fi
disable_rpfilter
enable_fwding 0