added service
This commit is contained in:
parent
2f5696dff0
commit
9bbdee00e8
34
README.md
34
README.md
|
@ -26,9 +26,9 @@ To invert the TXD pin on the FTDI device, programming the EEPROM is needed. With
|
||||||
|
|
||||||
### Commmon Distributions
|
### Commmon Distributions
|
||||||
|
|
||||||
Make shure the device is recocntied as ttyUSB after plug in with `dmesg`.<br/>
|
Make sure the device is after plug in recognized as ttyUSB with `dmesg`.<br/>
|
||||||
Edit the alarm.sh with your device name, like `/dev/ttyUSB0`. <br/>
|
Edit the alert.sh with your device name, like `/dev/ttyUSB0`. <br/>
|
||||||
Run `bash ./alarm.sh` for starting the alarm.<br/>
|
Run `bash ./alert.sh` for starting the alarm.<br/>
|
||||||
|
|
||||||
### openWrt
|
### openWrt
|
||||||
|
|
||||||
|
@ -38,7 +38,31 @@ Run `bash ./alarm.sh` for starting the alarm.<br/>
|
||||||
|
|
||||||
Make shure the device is recocntied as ttyUSB after plug in with `dmesg`.<br/>
|
Make shure the device is recocntied as ttyUSB after plug in with `dmesg`.<br/>
|
||||||
Edit the alarm.sh with your device name, like `/dev/ttyUSB0`. <br/>
|
Edit the alarm.sh with your device name, like `/dev/ttyUSB0`. <br/>
|
||||||
Run `bash ./alarm.sh` for starting the alarm.<br/>
|
Run `bash ./alert.sh` for starting the alarm.<br/>
|
||||||
|
|
||||||
### Service
|
### Service
|
||||||
todo
|
`nano /etc/init.d/alarm`
|
||||||
|
|
||||||
|
```
|
||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
|
||||||
|
START=99
|
||||||
|
|
||||||
|
restart() {
|
||||||
|
bash /root/alert.sh > /dev/null 2>&1 &
|
||||||
|
bash /root/alert.sh start > /dev/null 2>&1 &
|
||||||
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
|
bash /root/alert.sh start > /dev/null 2>&1 &
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
bash /root/alert.sh > /dev/null 2>&1 &
|
||||||
|
}
|
||||||
|
```
|
||||||
|
`chmod +x /etc/init.d/alarm`
|
||||||
|
|
||||||
|
`/etc/init.d/alarm start`
|
||||||
|
|
||||||
|
`/etc/init.d/alarm stop`
|
Loading…
Reference in New Issue