Created
June 30, 2024 15:50
-
-
Save RedstoneWizard08/97a5a97fc311218ef32b7e0717e071d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/data/data/com.termux/files/usr/bin/bash | |
if [[ -z "$1" ]] || [[ -z "$2" ]] || [[ -z "$3" ]]; then | |
echo "Usage: $0 [username] [db] [dir]" | |
exit 1 | |
fi | |
dir="$3" | |
pkg i -y postgresql | |
mkdir -p "$dir" | |
initdb "$dir" | |
pg_ctl -D "$dir" start | |
createuser --superuser --pwprompt "$1" | |
createdb "$2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment