diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-02-02 10:00:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-02-02 10:00:00 +0000 |
commit | 32322960234c8ec91e0d42835a3ec5ee63305070 (patch) | |
tree | 71d79574de0193778ad6cc6c96dfd4f74fa6bbbb /system-config/examples/live-config-foobar/components/9000-foobar | |
parent | Initial commit. (diff) | |
download | open-infrastructure-system-tools-32322960234c8ec91e0d42835a3ec5ee63305070.tar.xz open-infrastructure-system-tools-32322960234c8ec91e0d42835a3ec5ee63305070.zip |
Adding upstream version 20190202.upstream/20190202
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'system-config/examples/live-config-foobar/components/9000-foobar')
-rwxr-xr-x | system-config/examples/live-config-foobar/components/9000-foobar | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/system-config/examples/live-config-foobar/components/9000-foobar b/system-config/examples/live-config-foobar/components/9000-foobar new file mode 100755 index 0000000..136943b --- /dev/null +++ b/system-config/examples/live-config-foobar/components/9000-foobar @@ -0,0 +1,67 @@ +#!/bin/sh + +## live-config-foobar(7) - Additional Configuration Components for live systems +## Copyright (C) 2006-2015 Daniel Baumann <mail@daniel-baumann.ch> +## Copyright (C) 2015 John Doe <john@example.org> +## +## live-config-foobar comes with ABSOLUTELY NO WARRANTY; for details see COPYING. +## This is free software, and you are welcome to redistribute it +## under certain conditions; see COPYING for details. + + +set -e + +Cmdline () +{ + # Boot parameters can be acted up either this way... + if ! echo ${LIVE_CONFIG_CMDLINE} | grep -qs "example.foobar" && \ + ! echo ${LIVE_CONFIG_CMDLINE} | grep -qs "foobar" + then + return + fi + + # ...or if you want to specify certain options: + for _PARAMETER in ${LIVE_CONFIG_CMDLINE} + do + case "${_PARAMETER}" in + example.foobar=*|foobar=*) + EXAMPLE_FOOBAR="${_PARAMETER#*foobar=}" + ;; + esac + done +} + +Init () +{ + # Checking if package is installed or already configured + if [ ! -e /var/lib/dpkg/info/foobar.list ] || \ + [ -e /var/lib/live/config/foobar ] + then + exit 0 + fi + + echo -n " foobar" +} + +Config () +{ + # Configuring foobar either this way... + if [ -n "${EXAMPLE_FOOBAR}" ] + then + sleep 1 + fi + + # ...or if you want to specify certain options: + case "${EXAMPLE_FOOBAR}" in + foo) + sleep 1 + ;; + esac + + # Creating state file + touch /var/lib/live/config/foobar +} + +Cmdline +Init +Config |