feat(packages/check): add check package with nginx config checker

This commit is contained in:
Mohammad Rafiq 2025-06-13 06:47:50 +08:00
parent 127cc02ecc
commit 662049ba4b
No known key found for this signature in database
2 changed files with 21 additions and 0 deletions

View file

@ -64,6 +64,7 @@ in
pantheon.deploy
pantheon.edit
pantheon.commit
pantheon.check
inputs.nixspect.packages."x86_64-linux".nixspect
];

View file

@ -0,0 +1,20 @@
{ pkgs, ... }:
pkgs.writeShellScriptBin "check" # bash
''
check_nginx() {
ssh apollo systemctl show nginx | grep '^ExecStart=' | grep -oP ' -c \K[^ ]+' | xargs cat
}
while [[ $# -gt 0 ]]; do
case "$1" in
nginx)
check_nginx
exit 0
;;
*)
echo "Unrecognised parameter."
exit 1
;;
esac
done
''