summaryrefslogtreecommitdiffstats
path: root/system-config/examples/hooks/passwd
diff options
context:
space:
mode:
Diffstat (limited to 'system-config/examples/hooks/passwd')
-rwxr-xr-xsystem-config/examples/hooks/passwd30
1 files changed, 30 insertions, 0 deletions
diff --git a/system-config/examples/hooks/passwd b/system-config/examples/hooks/passwd
new file mode 100755
index 0000000..38b5171
--- /dev/null
+++ b/system-config/examples/hooks/passwd
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+echo
+echo "live-config hook: passwd"
+
+_USERNAME=""
+
+while [ "${_USERNAME}" != q ]
+do
+ echo
+ echo -n "Enter username [q for quit]: "
+
+ read _USERNAME
+
+ _USERNAME="${_USERNAME:-${LIVE_USERNAME}}"
+
+ case "${_USERNAME}" in
+ root)
+ passwd
+ ;;
+
+ *)
+ if [ -n "${_USERNAME}" ]
+ then
+ echo
+ passwd "${_USERNAME}"
+ fi
+ ;;
+ esac
+done