All pastes #191704 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-10-05 07:47 UTC
rendered paste body
#!/bin/sh
# Script made by radi0head on irc.freenode.net ##slackware
# Start/stop/restart lircd.
# Replace "0" with your device if it's not "0"

DEVICE=0

lircd_start() {
  /usr/sbin/lircd --device=/dev/lirc$DEVICE
  echo "Starting lircd..."
}

lircd_stop() {
  /bin/killall lircd
  echo "Stopping lircd..."
}

lircd_restart() {
  /bin/killall lircd
  /usr/bin/sleep 1
  /usr/sbin/lircd --device=/dev/lirc$DEVICE
  echo "Restarting lircd..."
}

case "$1" in
'start')
  lircd_start
  ;;
'stop')
  lircd_stop
  ;;
'restart')
  lircd_restart
  ;;
*)
  # Default is "start"
  lircd_start
esac