Hi, On Thu, 14 May 2009 21:24:22 +0530 Y Giridhar Appaji Nag <app...@debian.org> wrote:
> Hi Harald, > > Thank you for the bug report. > > On 09/05/08 11:35 +0200, Harald Braumann said ... > > There is no support for suspend/resume with pm-utils. > > > > ifplugd thould contain a script similar > > to /etc/apm/scripts.d/ifplugd for /etc/pm/sleep.d > > Would the same script be good enough? I've attached my script (forgot to send it). It's mainly a copy of /etc/apm/suspend.d/20ifplugd. So I guess you could merge them and use the same script. Differences: - pm-utils can call the script with arguments `hibernate' and `thaw' (in addition to `suspend' and `resume') - there is no 2nd argument `standby' or some such. But it doesn't hurt to check for it, either. > Alternatively, if you can > point me to some documentation as to how I can write a script > specifically for pm-utils, I will do that. man pm-utils Cheers, harry
#!/bin/sh # # suspend/resume ifplugd [ -f /etc/default/ifplugd ] || exit 0 . /etc/default/ifplugd [ "$SUSPEND_ACTION" ] || [ "$SUSPEND_ACTION" != "none" ] || exit 0 if [ "$SUSPEND_ACTION" = "suspend" ] ; then RESUME_ACTION="resume" elif [ "$SUSPEND_ACTION" = "stop" ] ; then RESUME_ACTION="start" else exit 0 fi case "$1" in hibernate|suspend) /etc/init.d/ifplugd ${SUSPEND_ACTION} ;; thaw|resume) /etc/init.d/ifplugd ${RESUME_ACTION} ;; *) exit 1 ;; esac
signature.asc
Description: PGP signature