Update workflows
This commit is contained in:
parent
0f7ea7610d
commit
3b4a666e02
116
.github/workflows/main.yml
vendored
116
.github/workflows/main.yml
vendored
@ -20,16 +20,22 @@ jobs:
|
|||||||
- name: Check
|
- name: Check
|
||||||
if: success()
|
if: success()
|
||||||
run: |
|
run: |
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
if [ ! -x /usr/bin/shellcheck ]; then
|
||||||
sudo apt-get -yq update
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
sudo apt-get -yq install shellcheck
|
sudo apt-get -yq update
|
||||||
|
sudo apt-get -yq install shellcheck
|
||||||
|
fi
|
||||||
|
|
||||||
export SHELLCHECK_OPTS="-e SC1091,SC1117"
|
|
||||||
cd "$GITHUB_WORKSPACE"
|
cd "$GITHUB_WORKSPACE"
|
||||||
pwd
|
pwd
|
||||||
ls -l | grep 'vpnsetup\.sh'
|
ls -ld vpnsetup.sh
|
||||||
|
|
||||||
|
export SHELLCHECK_OPTS="-e SC1091,SC1117"
|
||||||
shellcheck --version
|
shellcheck --version
|
||||||
shellcheck *.sh extras/*.sh
|
shopt -s globstar
|
||||||
|
ls -ld -- **/*.sh
|
||||||
|
shellcheck **/*.sh
|
||||||
|
shopt -u globstar
|
||||||
|
|
||||||
test_set_1:
|
test_set_1:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -48,8 +54,10 @@ jobs:
|
|||||||
echo "Waiting 60 seconds..."
|
echo "Waiting 60 seconds..."
|
||||||
sleep 60
|
sleep 60
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p "$GITHUB_WORKSPACE/testing/${OS_VERSION//:}"
|
mkdir -p "$GITHUB_WORKSPACE/testing/${OS_VERSION//:}"
|
||||||
cd "$GITHUB_WORKSPACE/testing/${OS_VERSION//:}"
|
cd "$GITHUB_WORKSPACE/testing/${OS_VERSION//:}"
|
||||||
|
|
||||||
cat > run.sh <<'EOF'
|
cat > run.sh <<'EOF'
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
@ -65,16 +73,17 @@ jobs:
|
|||||||
service rsyslog start
|
service rsyslog start
|
||||||
wget -t 3 -T 30 -nv -O vpnsetup.sh https://git.io/vpnsetup
|
wget -t 3 -T 30 -nv -O vpnsetup.sh https://git.io/vpnsetup
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sh vpnsetup.sh
|
sh vpnsetup.sh
|
||||||
if [ "$1" = "centos" ]; then
|
if [ "$1" = "centos" ]; then
|
||||||
systemctl start fail2ban
|
systemctl start fail2ban
|
||||||
systemctl start ipsec
|
systemctl start ipsec
|
||||||
systemctl start xl2tpd
|
systemctl start xl2tpd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 10
|
sleep 10
|
||||||
netstat -anpu
|
netstat -anpu | grep pluto
|
||||||
netstat -anpu | grep -q pluto
|
netstat -anpu | grep xl2tpd
|
||||||
netstat -anpu | grep -q xl2tpd
|
|
||||||
iptables -nL
|
iptables -nL
|
||||||
iptables -nL | grep -q '192\.168\.42\.0/24'
|
iptables -nL | grep -q '192\.168\.42\.0/24'
|
||||||
iptables -nL -t nat
|
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 "l2tp-psk"'
|
||||||
grep pluto /var/log/secure | grep -q 'added connection description "xauth-psk"'
|
grep pluto /var/log/secure | grep -q 'added connection description "xauth-psk"'
|
||||||
grep xl2tpd /var/log/messages
|
grep xl2tpd /var/log/messages
|
||||||
grep xl2tpd /var/log/messages | grep -q 'Listening on IP address 0\.0\.0\.0, port 1701'
|
|
||||||
else
|
else
|
||||||
grep pluto /var/log/auth.log
|
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 "l2tp-psk"'
|
||||||
grep pluto /var/log/auth.log | grep -q 'added connection description "xauth-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 xl2tpd /var/log/syslog | grep -q 'Listening on IP address 0\.0\.0\.0, port 1701'
|
|
||||||
fi
|
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
|
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
|
bash ikev2.sh <<ANSWERS
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
y
|
y
|
||||||
ANSWERS
|
ANSWERS
|
||||||
|
|
||||||
|
ls -ld /etc/ipsec.d/ikev2vpnca*.cer
|
||||||
|
ls -ld /etc/ipsec.d/vpnclient*.p12
|
||||||
if [ "$1" = "centos" ]; then
|
if [ "$1" = "centos" ]; then
|
||||||
systemctl restart ipsec
|
systemctl restart ipsec
|
||||||
sleep 10
|
sleep 10
|
||||||
@ -111,14 +136,18 @@ jobs:
|
|||||||
grep pluto /var/log/auth.log | tail -n 20
|
grep pluto /var/log/auth.log | tail -n 20
|
||||||
grep pluto /var/log/auth.log | grep -q 'added connection description "ikev2-cp"'
|
grep pluto /var/log/auth.log | grep -q 'added connection description "ikev2-cp"'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
bash ikev2.sh <<ANSWERS
|
bash ikev2.sh <<ANSWERS
|
||||||
y
|
y
|
||||||
vpnclient2
|
vpnclient2
|
||||||
|
|
||||||
|
|
||||||
ANSWERS
|
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
|
exit 0
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
@ -187,9 +216,11 @@ jobs:
|
|||||||
echo "Waiting 60 seconds..."
|
echo "Waiting 60 seconds..."
|
||||||
sleep 60
|
sleep 60
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p /opt/src
|
mkdir -p /opt/src
|
||||||
cd /opt/src
|
cd /opt/src
|
||||||
echo "# hwdsl2" > run.sh
|
echo "# hwdsl2" > run.sh
|
||||||
|
|
||||||
OS_NAME=$(echo "$OS_VERSION" | head -c6)
|
OS_NAME=$(echo "$OS_VERSION" | head -c6)
|
||||||
if [ "$OS_NAME" = "centos" ]; then
|
if [ "$OS_NAME" = "centos" ]; then
|
||||||
yum -y -q install wget rsyslog
|
yum -y -q install wget rsyslog
|
||||||
@ -202,11 +233,12 @@ jobs:
|
|||||||
service rsyslog start
|
service rsyslog start
|
||||||
wget -t 3 -T 30 -nv -O vpnsetup.sh https://git.io/vpnsetup
|
wget -t 3 -T 30 -nv -O vpnsetup.sh https://git.io/vpnsetup
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sh vpnsetup.sh
|
sh vpnsetup.sh
|
||||||
|
|
||||||
sleep 10
|
sleep 10
|
||||||
netstat -anpu
|
netstat -anpu | grep pluto
|
||||||
netstat -anpu | grep -q pluto
|
netstat -anpu | grep xl2tpd
|
||||||
netstat -anpu | grep -q xl2tpd
|
|
||||||
iptables -nL
|
iptables -nL
|
||||||
iptables -nL | grep -q '192\.168\.42\.0/24'
|
iptables -nL | grep -q '192\.168\.42\.0/24'
|
||||||
iptables -nL -t nat
|
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 "l2tp-psk"'
|
||||||
grep pluto /var/log/secure | grep -q 'added connection description "xauth-psk"'
|
grep pluto /var/log/secure | grep -q 'added connection description "xauth-psk"'
|
||||||
grep xl2tpd /var/log/messages
|
grep xl2tpd /var/log/messages
|
||||||
grep xl2tpd /var/log/messages | grep -q 'Listening on IP address 0\.0\.0\.0, port 1701'
|
|
||||||
else
|
else
|
||||||
grep pluto /var/log/auth.log
|
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 "l2tp-psk"'
|
||||||
grep pluto /var/log/auth.log | grep -q 'added connection description "xauth-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 xl2tpd /var/log/syslog | grep -q 'Listening on IP address 0\.0\.0\.0, port 1701'
|
|
||||||
fi
|
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
|
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
|
bash ikev2.sh <<ANSWERS
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
y
|
y
|
||||||
ANSWERS
|
ANSWERS
|
||||||
|
|
||||||
|
ls -ld /etc/ipsec.d/ikev2vpnca*.cer
|
||||||
|
ls -ld /etc/ipsec.d/vpnclient*.p12
|
||||||
sleep 10
|
sleep 10
|
||||||
if [ "$OS_NAME" = "centos" ]; then
|
if [ "$OS_NAME" = "centos" ]; then
|
||||||
grep pluto /var/log/secure | tail -n 20
|
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 | tail -n 20
|
||||||
grep pluto /var/log/auth.log | grep -q 'added connection description "ikev2-cp"'
|
grep pluto /var/log/auth.log | grep -q 'added connection description "ikev2-cp"'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
bash ikev2.sh <<ANSWERS
|
bash ikev2.sh <<ANSWERS
|
||||||
y
|
y
|
||||||
vpnclient2
|
vpnclient2
|
||||||
|
|
||||||
|
|
||||||
ANSWERS
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user