Skip to content

Instantly share code, notes, and snippets.

@morenitux
Created May 7, 2020 21:23
Show Gist options
  • Save morenitux/e7d595938b947ba4e695f4592205e947 to your computer and use it in GitHub Desktop.
Save morenitux/e7d595938b947ba4e695f4592205e947 to your computer and use it in GitHub Desktop.
Small script to initialize pgadmin and turn it off. -Used only in case it was installed using pgAdmin 4 (Python Wheel)
#!/bin/bash
if [ "$1" == "start" ]; then
firefox -new-tab http://localhost:5050/browser/
python3 ~/.local/lib/python3.8/site-packages/pgadmin4/pgAdmin4.py
else
if [ "$1" == "stop" ];then
kill -9 $(ps -ef | grep '/.local/lib/python3.8/site-packages/pgadmin4/pgAdmin4.py' | awk 'NR==1 {print $2; exit}')
echo 'pgadmin4 closed.'
else
echo 'Check args, something es bad...'
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment