mirror of
https://github.com/RoganDawes/P4wnP1_aloa.git
synced 2025-04-11 13:39:03 +02:00
14 lines
475 B
Bash
14 lines
475 B
Bash
#!/bin/bash
|
|
echo "$TRIGGER"
|
|
if [ "$TRIGGER" = "TRIGGER_USB_GADGET_CONNECTED" ]; then
|
|
echo "USB gadget connected, starting terminal for ttyGS0"
|
|
# start systemd service unit, which spwans agetty for ttyGS0 if needed
|
|
service serial-getty@ttyGS0 start
|
|
fi
|
|
|
|
if [ "$TRIGGER" = "TRIGGER_USB_GADGET_DISCONNECTED" ]; then
|
|
echo "USB gadget disconnected, stopping terminal for ttyGS0"
|
|
# stop systemd service unit, which spwans agetty for ttyGS0
|
|
service serial-getty@ttyGS0 stop
|
|
fi
|