diff --git a/.github/workflows/test_set_1.yml b/.github/workflows/test_set_1.yml index f2d4182..882a840 100644 --- a/.github/workflows/test_set_1.yml +++ b/.github/workflows/test_set_1.yml @@ -17,7 +17,7 @@ jobs: if: github.repository_owner == 'hwdsl2' strategy: matrix: - os_version: ["centos:8s", "centos:7", "rockylinux:8", "almalinux:8", "amazonlinux:2", "oraclelinux:8", "oraclelinux:7"] + os_version: ["centos:8s", "centos:7", "rockylinux:9", "rockylinux:8", "almalinux:9", "almalinux:8", "amazonlinux:2", "oraclelinux:9", "oraclelinux:8", "oraclelinux:7"] fail-fast: false env: OS_VERSION: ${{ matrix.os_version }} @@ -51,7 +51,7 @@ jobs: } restart_ipsec() { - if grep -qs 'release 8' /etc/oracle-release; then + if grep -qs -E 'release (8|9)' /etc/oracle-release; then sleep 3 fi if ! command -v amazon-linux-extras; then @@ -85,58 +85,75 @@ jobs: cd /opt/src yum -y -q update yum -y -q install wget rsyslog + if grep -qs 'release 9' /etc/redhat-release; then + if grep -qi rocky /etc/redhat-release \ + || grep -qi alma /etc/redhat-release; then + yum -y -q install diffutils + fi + fi systemctl start rsyslog cp -f /opt/src/scripts/vpnsetup.sh . - cp -f /opt/src/scripts/extras/quickstart.sh . cp -f /opt/src/scripts/extras/vpnuninstall.sh ./vpnunst.sh sed -i -e '/curl /a sed -i "/swan_ver_latest=/s/^/#/" "$tmpdir/vpn.sh"' \ -e '/curl /a sed -i \x27/status=0/a sed -i "/swan_ver_latest=/s/^/#/" /opt/src/ikev2.sh\x27 "$tmpdir/vpn.sh"' \ - vpnsetup.sh quickstart.sh + vpnsetup.sh - for vpnsc in vpnsetup.sh quickstart.sh; do - sh "$vpnsc" + sh vpnsetup.sh - systemctl restart xl2tpd - restart_ipsec + systemctl restart xl2tpd + restart_ipsec + if ! grep -qs 'release 9' /etc/oracle-release; then restart_fail2ban cat /var/log/fail2ban.log + fi - netstat -anpu | grep pluto - netstat -anpu | grep xl2tpd + netstat -anpu | grep pluto + netstat -anpu | grep xl2tpd + if grep -qs 'release 9' /etc/redhat-release; then + nft list ruleset + nft list ruleset | grep -q '192\.168\.42\.0/24' + nft list ruleset | grep -q '192\.168\.43\.0/24' + else iptables -nvL iptables -nvL | grep -q 'ppp+' iptables -nvL | grep -q '192\.168\.43\.0/24' iptables -nvL -t nat iptables -nvL -t nat | grep -q '192\.168\.42\.0/24' iptables -nvL -t nat | grep -q '192\.168\.43\.0/24' - grep pluto "$log1" - grep xl2tpd "$log2" - ipsec status - ipsec status | grep -q l2tp-psk - ipsec status | grep -q xauth-psk - ipsec status | grep -q ikev2-cp + fi + grep pluto "$log1" + grep xl2tpd "$log2" + ipsec status + ipsec status | grep -q l2tp-psk + ipsec status | grep -q xauth-psk + ipsec status | grep -q ikev2-cp - ls -ld /etc/ipsec.d/vpnclient.mobileconfig - ls -ld /etc/ipsec.d/vpnclient.sswan - ls -ld /etc/ipsec.d/vpnclient.p12 + ls -ld /etc/ipsec.d/vpnclient.mobileconfig + ls -ld /etc/ipsec.d/vpnclient.sswan + ls -ld /etc/ipsec.d/vpnclient.p12 - ls -l /usr/bin/ikev2.sh - ls -l /usr/bin/addvpnuser.sh - ls -l /usr/bin/delvpnuser.sh - ls -l /opt/src/ikev2.sh - ls -l /opt/src/addvpnuser.sh - ls -l /opt/src/delvpnuser.sh + ls -l /usr/bin/ikev2.sh + ls -l /usr/bin/addvpnuser.sh + ls -l /usr/bin/delvpnuser.sh + ls -l /opt/src/ikev2.sh + ls -l /opt/src/addvpnuser.sh + ls -l /opt/src/delvpnuser.sh bash vpnunst.sh <