19 lines
281 B
Plaintext
19 lines
281 B
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
PIN_PAPOWER=5
|
||
|
|
||
|
# init
|
||
|
gpio mode $PIN_PAPOWER output
|
||
|
|
||
|
# command
|
||
|
if [[ "$1" == "on" ]]; then
|
||
|
gpio write $PIN_PAPOWER 1
|
||
|
elif [[ "$1" == "off" ]]; then
|
||
|
gpio write $PIN_PAPOWER 0
|
||
|
elif [[ "$1" == "read" ]]; then
|
||
|
gpio read $PIN_PAPOWER
|
||
|
else
|
||
|
gpio toggle $PIN_PAPOWER
|
||
|
fi
|
||
|
|