From 32322960234c8ec91e0d42835a3ec5ee63305070 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 2 Feb 2019 11:00:00 +0100 Subject: Adding upstream version 20190202. Signed-off-by: Daniel Baumann --- .../live-config-foobar/components/9000-foobar | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100755 system-config/examples/live-config-foobar/components/9000-foobar (limited to 'system-config/examples/live-config-foobar/components') 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 +## Copyright (C) 2015 John Doe +## +## 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 -- cgit v1.2.3