summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2008-03-09 15:11:08 -0500
committerVictor Lowther <victor.lowther@gmail.com>2008-03-09 15:11:08 -0500
commit0978de0966987eb2426cfdb3a78d77eca7c4ed98 (patch)
tree6077a0b941cd59c5e8bded9d91362a7a966ebb49
parent73157d2bd3fc9ece5b5747bf69dfc39d4b2e0390 (diff)
Added support for passing default parameters.
We add them in the "$PM_UTILS_ETCDIR/parameters" file, and they are simply appended to the PM_CMDLINE env variable.
-rw-r--r--pm/pm-functions.in13
1 files changed, 13 insertions, 0 deletions
diff --git a/pm/pm-functions.in b/pm/pm-functions.in
index bdea9c9..197c002 100644
--- a/pm/pm-functions.in
+++ b/pm/pm-functions.in
@@ -63,6 +63,19 @@ mkdir -p "$STORAGEDIR"
done
}
+[ -f "$PM_UTILS_ETCDIR/parameters" ] && {
+ # loop through the parameters file, and add each line in it to the
+ # end of PM_CMDLINE.
+ # Comments begin with hashmarks and run to the end of the line.
+ # Because we are modifying an env var, the while read loop cannot
+ # run in a pipe like the previous one did.
+ while read parameter; do
+ parameter="$(echo $parameter |sed 's,#.*$,,g')"
+ [ -z "$parameter" ] && continue
+ PM_CMDLINE="${PM_CMDLINE} $parameter"
+ done < "$PM_UTILS_ETCDIR/parameters"
+}
+
take_suspend_lock()
{
VT=$(fgconsole)