feat(packages/check): add check package with nginx config checker
This commit is contained in:
parent
127cc02ecc
commit
662049ba4b
2 changed files with 21 additions and 0 deletions
|
@ -64,6 +64,7 @@ in
|
||||||
pantheon.deploy
|
pantheon.deploy
|
||||||
pantheon.edit
|
pantheon.edit
|
||||||
pantheon.commit
|
pantheon.commit
|
||||||
|
pantheon.check
|
||||||
inputs.nixspect.packages."x86_64-linux".nixspect
|
inputs.nixspect.packages."x86_64-linux".nixspect
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
20
packages/check/default.nix
Normal file
20
packages/check/default.nix
Normal 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
|
||||||
|
''
|
Loading…
Add table
Add a link
Reference in a new issue