fix USB-C CAT after reboot

main 0.0.3b
Links 2022-04-16 14:58:36 +02:00
rodzic a053245356
commit 3d98272300
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 68FB9F01C0C482FC
3 zmienionych plików z 6 dodań i 1 usunięć

Wyświetl plik

@ -2,6 +2,7 @@
Description=USB-C Port RAW CAT control
Requires=x6100_socat_cat.service
Requires=x6100_cat_mux.service
Requires=x6100_app.service
[Service]
User=root

Wyświetl plik

@ -4,6 +4,7 @@ Requires=x6100_chroot.service
[Service]
User=root
Type=notify
ExecStart=/root/run_x6100_socat_app.sh start
ExecStop=/root/run_x6100_socat_app.sh stop
Restart=on-failure

Wyświetl plik

@ -18,6 +18,9 @@ if [ "$ACTION" == "start" ] ; then
if [ -e "${CAT_DEV_NEW}" ] ; then
rm ${CAT_DEV_NEW}
fi
if [ -e "${CAT_DEV_ORG}" ] ; then
rm ${CAT_DEV_ORG}
fi
if [ ! -e "${CAT_DEV_ORG}" ] ; then
# create orginal
@ -25,6 +28,7 @@ if [ "$ACTION" == "start" ] ; then
chown root:dialout ${CAT_DEV_ORG}
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
else
if [ -e "${CAT_DEV_ORG}" ] ; then
@ -43,5 +47,4 @@ else
# restore orginal
mknod -m 660 ${CAT_DEV} c 4 66
chown root:dialout ${CAT_DEV}
fi