Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > db8d50b45fb15e865b7becf99650beea > files > 14

powerman-2.3.25-1.mga7.armv7hl.rpm

# Here's an example of how to start bash as a coprocess from powerman
# and get it to execute commands for you.  powerman.conf should contain:
#
#   include "/etc/powerman/bashfun.dev"
#   device "bf0" "bashfun" "/bin/bash |&"
#   node "b1" "bf0" "1"
#
specification  "bashfun" {
	timeout 5

	plug name { "1" }
 
	script login {
		send "export PS1='Pm>'\n"
		expect "Pm>"
		send "PLUG_STATE=off\n"
		expect "Pm>"
	}
	script status {
		send "echo $PLUG_STATE\n"
		expect "(off|on)"
		setplugstate "1" $1 on="on" off="off"
		expect "Pm>"
	}
	script on {
		send "PLUG_STATE=on\n"
		expect "Pm>"
	}
	script off {
		send "PLUG_STATE=off\n"
		expect "Pm>"
	}
}