Hvacker/script.sh

23 lines
724 B
Bash
Raw Permalink Normal View History

2023-12-05 20:34:12 -05:00
#!/bin/bash
export PGHOST=localhost
export PGUSER="postgres"
export PGDATABASE="postgres"
export PGPASSWORD="thisisthesoundofamannamedpostgres"
export PGPORT=5432
2023-12-05 20:34:12 -05:00
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
cd /home/sage/projects/hvacker || exit 1
2023-12-05 20:34:12 -05:00
whereis npm
npm start | while read line; do
echo "$line"
if [[ "$line" == *"app http request failed getaddrinfo ENOTFOUND slack.com"* ]] ||
[[ "$line" == *"node:internal/errors"* ]] ||
[[ "$line" == *"Cannot set headers after"* ]]; then
2023-12-05 20:34:12 -05:00
systemctl restart hvacker
exit 1
fi
done