Bash script firewalld
hello if anyone there can correct my bash script to run firewalld
Code:
#!/bin/bash Code:
firewall-cmd --zone=public --add-port=8024/tcp varpubport - 8024 varintport - 22 varip - 192.168.122.204 ---------- script error: - Error: INVALID_FORWARD: missing port I detected error at first fw-cmd , inserted space after port number before /tcp, no idea how to correct it please help -------- to MOD , move accordingly if it not in right place thanks |
Quote:
Quote:
set -x would catch these. Even better, use https://www.shellcheck.net Code:
Line 3: |
thanks for input , i follow all the suggestion corrected the missing
Code:
[root@OL8-DEF15 ~]# cat fwtest Code:
[root@OL8-DEF15 ~]# ./fwtest Code:
[root@OL8-DEF15 ~]# firewall-cmd --list-all |
You did not make the rules permanent. Reloading restored the original rules.
|
thank you for all problem solved ,
Code:
[root@OL8-DEF15 ~]# cat fwtest Code:
Open TCP Port And Forward to Other IP address , Now Enter Public Port Number ? Code:
[root@OL8-DEF15 ~]# firewall-cmd --list-all regards |
All times are GMT -5. The time now is 11:08 AM. |