Skip to content

Instantly share code, notes, and snippets.

@uemuraj
Created November 24, 2016 01:25
Show Gist options
  • Save uemuraj/8433969323deb8be31e99cfdafb29b92 to your computer and use it in GitHub Desktop.
Save uemuraj/8433969323deb8be31e99cfdafb29b92 to your computer and use it in GitHub Desktop.
CentOS7 でファイアウォールの設定をする時の覚え書き
#!/bin/sh
firewall-cmd --zone=public --list-all | grep "80/tcp" || firewall-cmd --permanent --zone=public --add-port=80/tcp
firewall-cmd --zone=public --list-all | grep "443/tcp" || firewall-cmd --permanent --zone=public --add-port=443/tcp
firewall-cmd --reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment