From caa571f7688eb1ffd2df8c9d908ee787a4503b51 Mon Sep 17 00:00:00 2001 From: Stanislas Date: Mon, 11 Nov 2019 15:37:09 +0900 Subject: [PATCH] Fix GitHub action (#515) --- .github/workflows/push.yml | 2 +- openvpn-install.sh | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 5fa44e3..f1a5ccb 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -6,6 +6,6 @@ jobs: steps: - uses: actions/checkout@master - name: shellcheck - uses: actions/bin/shellcheck@master + uses: ludeeus/action-shellcheck@0.0.1 with: args: openvpn-install.sh -e SC1091,SC2164,SC2034,SC1072,SC1073,SC1009 diff --git a/openvpn-install.sh b/openvpn-install.sh index 61facdc..8b1784c 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -18,6 +18,7 @@ function tunAvailable () { function checkOS () { if [[ -e /etc/debian_version ]]; then OS="debian" + # shellcheck disable=SC1091 source /etc/os-release if [[ "$ID" == "debian" || "$ID" == "raspbian" ]]; then @@ -51,6 +52,7 @@ function checkOS () { fi fi elif [[ -e /etc/system-release ]]; then + # shellcheck disable=SC1091 source /etc/os-release if [[ "$ID" = "centos" ]]; then OS="centos" @@ -652,7 +654,7 @@ function installOpenVPN () { chown -R root:root /etc/openvpn/easy-rsa/ rm -f ~/EasyRSA-unix-v${version}.tgz - cd /etc/openvpn/easy-rsa/ + cd /etc/openvpn/easy-rsa/ || return case $CERT_TYPE in 1) echo "set_var EASYRSA_ALGO ec" > vars @@ -1083,7 +1085,7 @@ function revokeClient () { fi CLIENT=$(tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep "^V" | cut -d '=' -f 2 | sed -n "$CLIENTNUMBER"p) - cd /etc/openvpn/easy-rsa/ + cd /etc/openvpn/easy-rsa/ || return ./easyrsa --batch revoke "$CLIENT" EASYRSA_CRL_DAYS=3650 ./easyrsa gen-crl # Cleanup @@ -1139,6 +1141,7 @@ function removeUnbound () { function removeOpenVPN () { echo "" + # shellcheck disable=SC2034 read -rp "Do you really want to remove OpenVPN? [y/n]: " -e -i n REMOVE if [[ "$REMOVE" = 'y' ]]; then # Get OpenVPN port from the configuration