summaryrefslogtreecommitdiffstats
path: root/system-config/examples/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'system-config/examples/hooks')
-rwxr-xr-xsystem-config/examples/hooks/cat26
-rwxr-xr-xsystem-config/examples/hooks/passwd30
-rwxr-xr-xsystem-config/examples/hooks/rm19
-rwxr-xr-xsystem-config/examples/hooks/sh9
-rwxr-xr-xsystem-config/examples/hooks/vi16
5 files changed, 100 insertions, 0 deletions
diff --git a/system-config/examples/hooks/cat b/system-config/examples/hooks/cat
new file mode 100755
index 0000000..cee5cde
--- /dev/null
+++ b/system-config/examples/hooks/cat
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+echo
+echo "live-config hook: cat"
+
+_FILENAME=""
+
+while [ "${_FILENAME}" != q ]
+do
+ echo
+ echo -n "Enter filename [q for quit]: "
+
+ read _FILENAME
+
+ if [ -n "${_FILENAME}" ]
+ then
+ echo
+ echo "Begin: ${_FILENAME}"
+ echo "--------------------------------------------------------------------------------"
+
+ cat "${_FILENAME}"
+
+ echo "--------------------------------------------------------------------------------"
+ echo "End: ${_FILENAME}"
+ fi
+done
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
diff --git a/system-config/examples/hooks/rm b/system-config/examples/hooks/rm
new file mode 100755
index 0000000..a7ffbbf
--- /dev/null
+++ b/system-config/examples/hooks/rm
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+echo
+echo "live-config hook: rm"
+
+_FILENAME=""
+
+while [ "${_FILENAME}" != q ]
+do
+ echo
+ echo -n "Enter filename [q for quit]: "
+
+ read _FILENAME
+
+ if [ -n "${_FILENAME}" ]
+ then
+ rm -rf "${_FILENAME}"
+ fi
+done
diff --git a/system-config/examples/hooks/sh b/system-config/examples/hooks/sh
new file mode 100755
index 0000000..737bcd7
--- /dev/null
+++ b/system-config/examples/hooks/sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+echo
+echo "live-config hook: sh"
+
+echo
+echo "Starting shell [logout for quit]: "
+
+sh
diff --git a/system-config/examples/hooks/vi b/system-config/examples/hooks/vi
new file mode 100755
index 0000000..2ae99e6
--- /dev/null
+++ b/system-config/examples/hooks/vi
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+echo
+echo "live-config hook: vi"
+
+_FILENAME=""
+
+while [ "${_FILENAME}" != q ]
+do
+ echo
+ echo -n "Enter filename [q for quit]: "
+
+ read _FILENAME
+
+ vi "${_FILENAME}"
+done