added service

This commit is contained in:
Hendrik Schutter 2020-05-12 09:14:13 +02:00
parent 2f5696dff0
commit 9bbdee00e8
1 changed files with 29 additions and 5 deletions

View File

@ -26,9 +26,9 @@ To invert the TXD pin on the FTDI device, programming the EEPROM is needed. With
### Commmon Distributions
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/>
Run `bash ./alarm.sh` for starting the alarm.<br/>
Make sure the device is after plug in recognized as ttyUSB with `dmesg`.<br/>
Edit the alert.sh with your device name, like `/dev/ttyUSB0`. <br/>
Run `bash ./alert.sh` for starting the alarm.<br/>
### 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/>
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
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`