mirror of
https://github.com/RobotechLille/cdf2018-principal
synced 2024-12-23 14:10:37 +01:00
40 lines
523 B
Bash
Executable file
40 lines
523 B
Bash
Executable file
#!/bin/sh
|
|
#
|
|
# Loads required hardware modules
|
|
#
|
|
|
|
start() {
|
|
printf "Starting hardware handling: "
|
|
modprobe pl2303 # USB↔Serial cable
|
|
modprobe i2c-bcm2708 # I2C
|
|
modprobe i2c-dev # I2C
|
|
/opt/chef/lcdOff.sh
|
|
echo "OK"
|
|
}
|
|
|
|
stop() {
|
|
printf "Stopping hardware handling: "
|
|
rmmod i2c-dev # I2C
|
|
rmmod i2c-bcm2708 # I2C
|
|
rmmod pl2303 # USB↔Serial cable
|
|
echo "OK"
|
|
}
|
|
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
restart|reload)
|
|
stop
|
|
start
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart}"
|
|
exit 1
|
|
esac
|
|
|
|
exit $?
|