summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pm/pm-functions.in14
-rw-r--r--src/pm-action.in1
2 files changed, 14 insertions, 1 deletions
diff --git a/pm/pm-functions.in b/pm/pm-functions.in
index 120bc33..197c002 100644
--- a/pm/pm-functions.in
+++ b/pm/pm-functions.in
@@ -17,6 +17,7 @@ set -a
PM_UTILS_LIBDIR="@PM-UTILS-LIBDIR@"
PM_UTILS_ETCDIR="@PM-UTILS-SYSCONFDIR@"
PM_UTILS_RUNDIR="/var/run/pm-utils"
+PM_CMDLINE="$*"
PATH=/sbin:/usr/sbin:/bin:/usr/bin:"${PM_UTILS_LIBDIR}"/bin
HIBERNATE_MODE="platform"
@@ -62,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)
diff --git a/src/pm-action.in b/src/pm-action.in
index 3359a1b..3872853 100644
--- a/src/pm-action.in
+++ b/src/pm-action.in
@@ -29,7 +29,6 @@
. "@PM-UTILS-LIBDIR@/pm-functions"
# save the command line parameters for the hooks.
-export PM_CMDLINE="$*"
help()
{
echo "${0##*/} [options]"