I'm automating the installation of an NFS server. Prior to starting the firewall i want to check:
systemctl status firewalld Firewall status: ● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled) Active: active (running) since Fri 2019-04-19 02:28:46 UTC; 27min ago Main PID: 129969 (firewalld) CGroup: /system.slice/firewalld.service └─129969 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid 1) need to unmask firewalld
2) is firewalld dead
for this i execute
STATUS=`systemctl status firewalld` echo "Firewall status: ${STATUS}" MASKED=`grep -e "masked" $STATUS` DEAD=`grep -e "dead" $STATUS` however, the grep command fails with:
grep: unrecognized option '--nofork' Usage: grep [OPTION]... PATTERN [FILE]... Try 'grep --help' for more information. grep: unrecognized option '--nofork' Usage: grep [OPTION]... PATTERN [FILE]... Try 'grep --help' for more information. grep fails on the pattern: --nofork grep assumes it's an option
I have read various posts but haven't found a solution to this problem. I thought I might use "sed" to remove the "--" but it fao=ils with the same error
Cheers, Roland