1
0
mirror of synced 2024-11-26 06:46:06 +03:00

Update workflows

This commit is contained in:
hwdsl2 2020-07-09 01:41:52 -05:00
parent 0f7ea7610d
commit 3b4a666e02

View File

@ -20,16 +20,22 @@ jobs:
- name: Check
if: success()
run: |
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,15 +93,28 @@ 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 <<ANSWERS
@ -101,6 +123,9 @@ jobs:
y
ANSWERS
ls -ld /etc/ipsec.d/ikev2vpnca*.cer
ls -ld /etc/ipsec.d/vpnclient*.p12
if [ "$1" = "centos" ]; then
systemctl restart ipsec
sleep 10
@ -111,14 +136,18 @@ jobs:
grep pluto /var/log/auth.log | tail -n 20
grep pluto /var/log/auth.log | grep -q 'added connection description "ikev2-cp"'
fi
bash ikev2.sh <<ANSWERS
y
vpnclient2
ANSWERS
ls -l | grep 'vpnsetup\.sh'
ls -l | grep 'ikev2\.sh'
ls -ld /etc/ipsec.d/vpnclient2*.p12
ls -ld vpnsetup.sh
ls -ld ikev2.sh
exit 0
EOF
@ -187,9 +216,11 @@ jobs:
echo "Waiting 60 seconds..."
sleep 60
fi
mkdir -p /opt/src
cd /opt/src
echo "# hwdsl2" > 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,15 +248,25 @@ 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 <<ANSWERS
@ -233,6 +275,9 @@ jobs:
y
ANSWERS
ls -ld /etc/ipsec.d/ikev2vpnca*.cer
ls -ld /etc/ipsec.d/vpnclient*.p12
sleep 10
if [ "$OS_NAME" = "centos" ]; then
grep pluto /var/log/secure | tail -n 20
@ -241,11 +286,14 @@ jobs:
grep pluto /var/log/auth.log | tail -n 20
grep pluto /var/log/auth.log | grep -q 'added connection description "ikev2-cp"'
fi
bash ikev2.sh <<ANSWERS
y
vpnclient2
ANSWERS
ls -l | grep 'vpnsetup\.sh'
ls -l | grep 'ikev2\.sh'
ls -ld /etc/ipsec.d/vpnclient2*.p12
ls -ld vpnsetup.sh
ls -ld ikev2.sh