From 3b4a666e028252035d3fb2c55bbb5f7717198f3f Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Thu, 9 Jul 2020 01:41:52 -0500 Subject: [PATCH] Update workflows --- .github/workflows/main.yml | 116 ++++++++++++++++++++++++++----------- 1 file changed, 82 insertions(+), 34 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5aa097b..b4227b2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,16 +20,22 @@ jobs: - name: Check if: success() run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get -yq update - sudo apt-get -yq install shellcheck + if [ ! -x /usr/bin/shellcheck ]; then + export DEBIAN_FRONTEND=noninteractive + sudo apt-get -yq update + sudo apt-get -yq install shellcheck + fi - export SHELLCHECK_OPTS="-e SC1091,SC1117" cd "$GITHUB_WORKSPACE" pwd - ls -l | grep 'vpnsetup\.sh' + ls -ld vpnsetup.sh + + export SHELLCHECK_OPTS="-e SC1091,SC1117" shellcheck --version - shellcheck *.sh extras/*.sh + shopt -s globstar + ls -ld -- **/*.sh + shellcheck **/*.sh + shopt -u globstar test_set_1: runs-on: ubuntu-latest @@ -48,8 +54,10 @@ jobs: echo "Waiting 60 seconds..." sleep 60 fi + mkdir -p "$GITHUB_WORKSPACE/testing/${OS_VERSION//:}" cd "$GITHUB_WORKSPACE/testing/${OS_VERSION//:}" + cat > run.sh <<'EOF' #!/bin/bash set -e @@ -65,16 +73,17 @@ jobs: service rsyslog start wget -t 3 -T 30 -nv -O vpnsetup.sh https://git.io/vpnsetup fi + sh vpnsetup.sh if [ "$1" = "centos" ]; then systemctl start fail2ban systemctl start ipsec systemctl start xl2tpd fi + sleep 10 - netstat -anpu - netstat -anpu | grep -q pluto - netstat -anpu | grep -q xl2tpd + netstat -anpu | grep pluto + netstat -anpu | grep xl2tpd iptables -nL iptables -nL | grep -q '192\.168\.42\.0/24' iptables -nL -t nat @@ -84,23 +93,39 @@ jobs: grep pluto /var/log/secure | grep -q 'added connection description "l2tp-psk"' grep pluto /var/log/secure | grep -q 'added connection description "xauth-psk"' grep xl2tpd /var/log/messages - grep xl2tpd /var/log/messages | grep -q 'Listening on IP address 0\.0\.0\.0, port 1701' else grep pluto /var/log/auth.log grep pluto /var/log/auth.log | grep -q 'added connection description "l2tp-psk"' grep pluto /var/log/auth.log | grep -q 'added connection description "xauth-psk"' grep xl2tpd /var/log/syslog - grep xl2tpd /var/log/syslog | grep -q 'Listening on IP address 0\.0\.0\.0, port 1701' fi + + VPN_IPSEC_PSK='your_ipsec_pre_shared_key' \ + VPN_USER='your_vpn_username' \ + VPN_PASSWORD='your_vpn_password' \ + sh vpnsetup.sh + if [ "$1" = "centos" ]; then + systemctl restart ipsec + fi + + grep "your_ipsec_pre_shared_key" /etc/ipsec.secrets + grep "your_vpn_username" /etc/ppp/chap-secrets + grep "your_vpn_password" /etc/ppp/chap-secrets + grep "your_vpn_username" /etc/ipsec.d/passwd + wget -t 3 -T 30 -nv -O ikev2.sh https://git.io/ikev2setup # hwdsl2 + sed -i 's/pk12util/pk12util -W test/' ikev2.sh bash ikev2.sh < run.sh + OS_NAME=$(echo "$OS_VERSION" | head -c6) if [ "$OS_NAME" = "centos" ]; then yum -y -q install wget rsyslog @@ -202,11 +233,12 @@ jobs: service rsyslog start wget -t 3 -T 30 -nv -O vpnsetup.sh https://git.io/vpnsetup fi + sh vpnsetup.sh + sleep 10 - netstat -anpu - netstat -anpu | grep -q pluto - netstat -anpu | grep -q xl2tpd + netstat -anpu | grep pluto + netstat -anpu | grep xl2tpd iptables -nL iptables -nL | grep -q '192\.168\.42\.0/24' iptables -nL -t nat @@ -216,23 +248,36 @@ jobs: grep pluto /var/log/secure | grep -q 'added connection description "l2tp-psk"' grep pluto /var/log/secure | grep -q 'added connection description "xauth-psk"' grep xl2tpd /var/log/messages - grep xl2tpd /var/log/messages | grep -q 'Listening on IP address 0\.0\.0\.0, port 1701' else grep pluto /var/log/auth.log grep pluto /var/log/auth.log | grep -q 'added connection description "l2tp-psk"' grep pluto /var/log/auth.log | grep -q 'added connection description "xauth-psk"' grep xl2tpd /var/log/syslog - grep xl2tpd /var/log/syslog | grep -q 'Listening on IP address 0\.0\.0\.0, port 1701' fi + + VPN_IPSEC_PSK='your_ipsec_pre_shared_key' \ + VPN_USER='your_vpn_username' \ + VPN_PASSWORD='your_vpn_password' \ + sh vpnsetup.sh + + grep "your_ipsec_pre_shared_key" /etc/ipsec.secrets + grep "your_vpn_username" /etc/ppp/chap-secrets + grep "your_vpn_password" /etc/ppp/chap-secrets + grep "your_vpn_username" /etc/ipsec.d/passwd + wget -t 3 -T 30 -nv -O ikev2.sh https://git.io/ikev2setup + sed -i 's/pk12util/pk12util -W test/' ikev2.sh bash ikev2.sh <