l 5: add mk_sql_pair

This commit is contained in:
lassulus 2016-04-13 16:37:26 +02:00
parent 6a009982af
commit f0863085c7
2 changed files with 20 additions and 0 deletions

View File

@ -8,6 +8,7 @@
ublock = pkgs.callPackage ./firefoxPlugins/ublock.nix {};
vimperator = pkgs.callPackage ./firefoxPlugins/vimperator.nix {};
};
mk_sql_pair = pkgs.callPackage ./mk_sql_pair/default.nix {};
mpv-poll = pkgs.callPackage ./mpv-poll/default.nix {};
xmonad-lass =
let src = pkgs.writeNixFromCabal "xmonad-lass.nix" ./xmonad-lass; in

View File

@ -0,0 +1,19 @@
{ 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
''