l 5: add mk_sql_pair
This commit is contained in:
parent
6a009982af
commit
f0863085c7
@ -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
|
||||
|
19
lass/5pkgs/mk_sql_pair/default.nix
Normal file
19
lass/5pkgs/mk_sql_pair/default.nix
Normal 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
|
||||
''
|
Loading…
Reference in New Issue
Block a user