aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislas Lange <stanislas.lange@pm.me>2020-08-03 17:47:22 +0200
committerStanislas Lange <stanislas.lange@pm.me>2020-08-03 17:47:31 +0200
commit2363b36735c2992476bb60f3f7253fd2d17a216b (patch)
tree632b93019cf07db6b2dd9c9520345ad52f531477
parent5a65e8866740be89e9c6773eebb5b2bb18a60332 (diff)
Shellcheck: move excludes to action env
-rw-r--r--.github/workflows/lint.yml28
-rw-r--r--wireguard-install.sh5
2 files changed, 11 insertions, 22 deletions
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 31fe34f..c123233 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -1,10 +1,4 @@
-on:
- push:
- branches:
- - master
- pull_request:
- branches:
- - master
+on: push
name: Lint
@@ -12,17 +6,17 @@ jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
- - name: shellcheck
- uses: ludeeus/action-shellcheck@0.5.0
- env:
- SHELLCHECK_OPTS: -e SC1091,SC1117,SC2001
+ - uses: actions/checkout@v2
+ - name: shellcheck
+ uses: ludeeus/action-shellcheck@0.5.0
+ env:
+ SHELLCHECK_OPTS: -e SC1091,SC1117,SC2001,SC2034
shfmt:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
- - name: shfmt
- uses: bltavares/actions/shfmt@master
- env:
- SHFMT_ARGS: -d
+ - uses: actions/checkout@v2
+ - name: shfmt
+ uses: bltavares/actions/shfmt@master
+ env:
+ SHFMT_ARGS: -d
diff --git a/wireguard-install.sh b/wireguard-install.sh
index b2e9a41..a8ce2d2 100644
--- a/wireguard-install.sh
+++ b/wireguard-install.sh
@@ -29,7 +29,6 @@ function checkVirt() {
function checkOS() {
# Check OS version
if [[ -e /etc/debian_version ]]; then
- # shellcheck disable=SC1091
source /etc/os-release
OS="${ID}" # debian or ubuntu
if [[ -e /etc/debian_version ]]; then
@@ -41,7 +40,6 @@ function checkOS() {
fi
fi
elif [[ -e /etc/fedora-release ]]; then
- # shellcheck disable=SC1091
source /etc/os-release
OS="${ID}"
elif [[ -e /etc/centos-release ]]; then
@@ -83,7 +81,6 @@ function installQuestions() {
done
until [[ ${SERVER_WG_NIC} =~ ^[a-zA-Z0-9_]+$ ]]; do
- # shellcheck disable=SC2034
read -rp "WireGuard interface name: " -e -i wg0 SERVER_WG_NIC
done
@@ -178,7 +175,6 @@ PrivateKey = ${SERVER_PRIV_KEY}" >"/etc/wireguard/${SERVER_WG_NIC}.conf"
if pgrep firewalld; then
FIREWALLD_IPV4_ADDRESS=$(echo "${SERVER_WG_IPV4}" | cut -d"." -f1-3)".0"
- # shellcheck disable=SC2001
FIREWALLD_IPV6_ADDRESS=$(echo "${SERVER_WG_IPV6}" | sed 's/:[^:]*$/:0/')
echo "PostUp = firewall-cmd --add-port ${SERVER_PORT}/udp && firewall-cmd --add-rich-rule='rule family=ipv4 source address=${FIREWALLD_IPV4_ADDRESS}/24 masquerade' && firewall-cmd --add-rich-rule='rule family=ipv6 source address=${FIREWALLD_IPV6_ADDRESS}/24 masquerade'
PostDown = firewall-cmd --remove-port ${SERVER_PORT}/udp && firewall-cmd --remove-rich-rule='rule family=ipv4 source address=${FIREWALLD_IPV4_ADDRESS}/24 masquerade' && firewall-cmd --remove-rich-rule='rule family=ipv6 source address=${FIREWALLD_IPV6_ADDRESS}/24 masquerade'" >>"/etc/wireguard/${SERVER_WG_NIC}.conf"
@@ -420,7 +416,6 @@ initialCheck
# Check if WireGuard is already installed and load params
if [[ -e /etc/wireguard/params ]]; then
- # shellcheck disable=SC1091
source /etc/wireguard/params
manageMenu
else