stockholm/lass/5pkgs/mk_sql_pair/default.nix
2016-04-27 12:52:16 +02:00

20 lines
304 B
Nix

{ pkgs, ... }:
pkgs.writeScriptBin "mk_sql_pair" ''
#!/bin/sh
name=$1
password=$2
if [ $# -ne 2 ]; then
echo '$1=name, $2=password'
exit 23;
fi
cat <<EOF
create database $name;
create user $name;
grant all on $name.* to $name@'localhost' identified by '$password';
EOF
''