kopia lustrzana https://github.com/Links2004/x6100-armbian
rodzic
a053245356
commit
3d98272300
|
@ -2,6 +2,7 @@
|
||||||
Description=USB-C Port RAW CAT control
|
Description=USB-C Port RAW CAT control
|
||||||
Requires=x6100_socat_cat.service
|
Requires=x6100_socat_cat.service
|
||||||
Requires=x6100_cat_mux.service
|
Requires=x6100_cat_mux.service
|
||||||
|
Requires=x6100_app.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=root
|
User=root
|
||||||
|
|
|
@ -4,6 +4,7 @@ Requires=x6100_chroot.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=root
|
User=root
|
||||||
|
Type=notify
|
||||||
ExecStart=/root/run_x6100_socat_app.sh start
|
ExecStart=/root/run_x6100_socat_app.sh start
|
||||||
ExecStop=/root/run_x6100_socat_app.sh stop
|
ExecStop=/root/run_x6100_socat_app.sh stop
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|
|
@ -18,6 +18,9 @@ if [ "$ACTION" == "start" ] ; then
|
||||||
if [ -e "${CAT_DEV_NEW}" ] ; then
|
if [ -e "${CAT_DEV_NEW}" ] ; then
|
||||||
rm ${CAT_DEV_NEW}
|
rm ${CAT_DEV_NEW}
|
||||||
fi
|
fi
|
||||||
|
if [ -e "${CAT_DEV_ORG}" ] ; then
|
||||||
|
rm ${CAT_DEV_ORG}
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -e "${CAT_DEV_ORG}" ] ; then
|
if [ ! -e "${CAT_DEV_ORG}" ] ; then
|
||||||
# create orginal
|
# create orginal
|
||||||
|
@ -25,6 +28,7 @@ if [ "$ACTION" == "start" ] ; then
|
||||||
chown root:dialout ${CAT_DEV_ORG}
|
chown root:dialout ${CAT_DEV_ORG}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
systemd-notify --ready --status="starting socat"
|
||||||
exec socat pty,link=${CAT_DEV_NEW},raw,user=root,group=dialout,echo=0 tcp-listen:9990,bind=127.0.0.1,fork
|
exec socat pty,link=${CAT_DEV_NEW},raw,user=root,group=dialout,echo=0 tcp-listen:9990,bind=127.0.0.1,fork
|
||||||
else
|
else
|
||||||
if [ -e "${CAT_DEV_ORG}" ] ; then
|
if [ -e "${CAT_DEV_ORG}" ] ; then
|
||||||
|
@ -43,5 +47,4 @@ else
|
||||||
# restore orginal
|
# restore orginal
|
||||||
mknod -m 660 ${CAT_DEV} c 4 66
|
mknod -m 660 ${CAT_DEV} c 4 66
|
||||||
chown root:dialout ${CAT_DEV}
|
chown root:dialout ${CAT_DEV}
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
Ładowanie…
Reference in New Issue