fixed systemd unit issues
This commit is contained in:
parent
14dd229abd
commit
43a35283db
10
install.sh
10
install.sh
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
# force run from root user
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
exec sudo "$0" "$@"
|
||||
exec sudo "$0" "$@"
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
|
@ -17,9 +17,9 @@ mkdir -p /etc/systemd/system
|
|||
|
||||
curl -sSL "https://git.openergy.ru/LUCKFOX/SIM800C/raw/branch/main/chat" > /etc/ppp/chatscripts/sim800c
|
||||
curl -sSL "https://git.openergy.ru/LUCKFOX/SIM800C/raw/branch/main/peer" > /etc/ppp/peers/sim800c
|
||||
curl -sSL "https://git.openergy.ru/LUCKFOX/SIM800C/raw/branch/main/script" > /etc/init.d/sim800c.sh
|
||||
curl -sSL "https://git.openergy.ru/LUCKFOX/SIM800C/raw/branch/main/service" > /etc/systemd/system/sim800c.service
|
||||
curl -sSL "https://git.openergy.ru/LUCKFOX/SIM800C/raw/branch/main/script" > /etc/init.d/sim800c
|
||||
curl -sSL "https://git.openergy.ru/LUCKFOX/SIM800C/raw/branch/main/service" > /etc/systemd/system/sim800.service
|
||||
|
||||
chmod +x /etc/init.d/sim800c
|
||||
systemctl enable sim800c
|
||||
systemctl start sim800c
|
||||
systemctl enable sim800
|
||||
systemctl start sim800
|
||||
|
|
|
|||
4
script
4
script
|
|
@ -1,10 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
# /etc/init.d/sim800c.sh
|
||||
# /etc/init.d/sim800c
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo "AT+CFUN=1,1" > /dev/ttyS3
|
||||
sleep 3
|
||||
echo "AT+IPR=115200" > /dev/ttyS3
|
||||
pon sim800c
|
||||
;;
|
||||
|
|
@ -14,6 +15,7 @@ stop)
|
|||
# echo "+++" > /dev/ttyS3
|
||||
# sleep 3
|
||||
echo "AT+CFUN=1,1" > /dev/ttyS3
|
||||
sleep 3
|
||||
;;
|
||||
restart|reload)
|
||||
$0 stop
|
||||
|
|
|
|||
6
service
6
service
|
|
@ -1,4 +1,4 @@
|
|||
# /etc/systemd/system/sim800c.service
|
||||
# /etc/systemd/system/sim800.service
|
||||
|
||||
[Unit]
|
||||
Description=SIM800C PPP Connection
|
||||
|
|
@ -7,8 +7,8 @@ After=rc-local.service
|
|||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/run/ppp0.pid
|
||||
ExecStart=/etc/init.d/sim800c.sh start
|
||||
ExecStop=/etc/init.d/sim800c.sh stop
|
||||
ExecStart=/etc/init.d/sim800c start
|
||||
ExecStop=/etc/init.d/sim800c stop
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user