mirror of
https://github.com/angristan/wireguard-install.git
synced 2024-11-24 05:56:02 +03:00
Shellcheck: move excludes to action env
This commit is contained in:
parent
5a65e88667
commit
2363b36735
28
.github/workflows/lint.yml
vendored
28
.github/workflows/lint.yml
vendored
@ -1,10 +1,4 @@
|
|||||||
on:
|
on: push
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
name: Lint
|
name: Lint
|
||||||
|
|
||||||
@ -12,17 +6,17 @@ jobs:
|
|||||||
shellcheck:
|
shellcheck:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: shellcheck
|
- name: shellcheck
|
||||||
uses: ludeeus/action-shellcheck@0.5.0
|
uses: ludeeus/action-shellcheck@0.5.0
|
||||||
env:
|
env:
|
||||||
SHELLCHECK_OPTS: -e SC1091,SC1117,SC2001
|
SHELLCHECK_OPTS: -e SC1091,SC1117,SC2001,SC2034
|
||||||
|
|
||||||
shfmt:
|
shfmt:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: shfmt
|
- name: shfmt
|
||||||
uses: bltavares/actions/shfmt@master
|
uses: bltavares/actions/shfmt@master
|
||||||
env:
|
env:
|
||||||
SHFMT_ARGS: -d
|
SHFMT_ARGS: -d
|
||||||
|
@ -29,7 +29,6 @@ function checkVirt() {
|
|||||||
function checkOS() {
|
function checkOS() {
|
||||||
# Check OS version
|
# Check OS version
|
||||||
if [[ -e /etc/debian_version ]]; then
|
if [[ -e /etc/debian_version ]]; then
|
||||||
# shellcheck disable=SC1091
|
|
||||||
source /etc/os-release
|
source /etc/os-release
|
||||||
OS="${ID}" # debian or ubuntu
|
OS="${ID}" # debian or ubuntu
|
||||||
if [[ -e /etc/debian_version ]]; then
|
if [[ -e /etc/debian_version ]]; then
|
||||||
@ -41,7 +40,6 @@ function checkOS() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
elif [[ -e /etc/fedora-release ]]; then
|
elif [[ -e /etc/fedora-release ]]; then
|
||||||
# shellcheck disable=SC1091
|
|
||||||
source /etc/os-release
|
source /etc/os-release
|
||||||
OS="${ID}"
|
OS="${ID}"
|
||||||
elif [[ -e /etc/centos-release ]]; then
|
elif [[ -e /etc/centos-release ]]; then
|
||||||
@ -83,7 +81,6 @@ function installQuestions() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
until [[ ${SERVER_WG_NIC} =~ ^[a-zA-Z0-9_]+$ ]]; do
|
until [[ ${SERVER_WG_NIC} =~ ^[a-zA-Z0-9_]+$ ]]; do
|
||||||
# shellcheck disable=SC2034
|
|
||||||
read -rp "WireGuard interface name: " -e -i wg0 SERVER_WG_NIC
|
read -rp "WireGuard interface name: " -e -i wg0 SERVER_WG_NIC
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -178,7 +175,6 @@ PrivateKey = ${SERVER_PRIV_KEY}" >"/etc/wireguard/${SERVER_WG_NIC}.conf"
|
|||||||
|
|
||||||
if pgrep firewalld; then
|
if pgrep firewalld; then
|
||||||
FIREWALLD_IPV4_ADDRESS=$(echo "${SERVER_WG_IPV4}" | cut -d"." -f1-3)".0"
|
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/')
|
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'
|
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"
|
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
|
# Check if WireGuard is already installed and load params
|
||||||
if [[ -e /etc/wireguard/params ]]; then
|
if [[ -e /etc/wireguard/params ]]; then
|
||||||
# shellcheck disable=SC1091
|
|
||||||
source /etc/wireguard/params
|
source /etc/wireguard/params
|
||||||
manageMenu
|
manageMenu
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user