From 530ba0d4f4f3d43009a9cde3f192ff14b876e7eb Mon Sep 17 00:00:00 2001 From: fbt Date: Mon, 17 Aug 2015 13:46:09 +0300 Subject: [PATCH] README --- README.md | 11 +++++++++++ userrc.in | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..582802e --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +userrc +====== + +A very simple script that executes ~/.config/rc.local for your users. + + > ./userrc -h + Usage: userrc [-c config] [-l logdir] + +The script has two access modes: blacklist (default) and explicit. +In blacklist mode, it will find and execute rc.local for every user in the system except for the ones in the `users_deny` array. +In expicit mode, it will find and execute rc.local for every user in the `users_allow` array. diff --git a/userrc.in b/userrc.in index b094275..6f1d424 100644 --- a/userrc.in +++ b/userrc.in @@ -74,6 +74,8 @@ runtime_config() { case "$1" in (-c) config="$2"; shift;; (-l) logdir="$2"; shift;; + (-h) usage; exit;; + (*) usage; exit 1;; esac shift done @@ -98,7 +100,7 @@ runtime_config() { } main() { - runtime_config + runtime_config "$@" get_allowed_users for u in "${users[@]}"; do