make insert_modules variables local

This commit is contained in:
HikariKnight 2022-03-10 15:34:45 +01:00
parent 3f0c99a2ba
commit 719d40d389
No known key found for this signature in database
GPG key ID: E8B239063B022F5A

View file

@ -1,7 +1,10 @@
#!/bin/bash #!/bin/bash
function insert_MODULES () { function insert_MODULES() {
# Get the header and enabled modules separately from the /etc/modules file # Get the header and enabled modules separately from the /etc/modules file
local MODULES_HEADER
local MODULES_ENABLED
local VENDOR_RESET
MODULES_HEADER=$(head -n $1 "$2" | grep -P "^#" | grep -v "# Added by quickpassthrough") MODULES_HEADER=$(head -n $1 "$2" | grep -P "^#" | grep -v "# Added by quickpassthrough")
MODULES_ENABLED=$(cat "$2" | grep -vP "^#" | grep -v "vendor-reset") MODULES_ENABLED=$(cat "$2" | grep -vP "^#" | grep -v "vendor-reset")
VENDOR_RESET=0 VENDOR_RESET=0