PortValhalla/scripts/Arch/Software/nginx/main.fish

24 lines
598 B
Fish
Raw Normal View History

2024-11-06 00:13:50 +00:00
#!/bin/env fish
begin
set -l dir (status dirname)
source "$dir/../../lib/software.fish"
inherit "$dir/../../../Common/Software/aliae/main.fish"
function installSW
yayinst nginx
end
function configureSW
set -l file "/etc/nginx/nginx.conf"
set -l config "include /etc/nginx/conf.d/*.conf;"
if not grep --fixed-strings "$config" "$file" >/dev/null
sudo sed -i "$file" -e "/^http {/,/^}/{ /^}/{" -e "i\\" -e "" -e "i \ $config" -e "} }"
end
sudo systemctl enable --now nginx
end
runInstaller $argv
end