added service
This commit is contained in:
		
							
								
								
									
										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
 | 
			
		||||
 | 
			
		||||
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`
 | 
			
		||||
		Reference in New Issue
	
	Block a user