File indexing completed on 2024-12-08 07:17:45

0001 #!/bin/bash
0002 # SPDX-FileCopyrightText: AtCore Authors
0003 # SPDX-License-Identifier: MIT
0004 uid=`id -u $USERNAME`
0005 if [ "$USER" = "root" ]
0006 then
0007         USER2=$SUDO_USER
0008         socat PTY,link=/dev/ttyVirtual1 PTY,link=/dev/ttyVirtual2&
0009         sleep 1
0010         chown $USER2:uucp /dev/ttyVirtual1
0011         chown $USER2:uucp /dev/ttyVirtual2
0012         echo "Created ports, set ownership to user $USER2"
0013         echo "Connect to /dev/ttyVirtual1 and /dev/ttyVirtual2"
0014 else
0015         echo "RUN WITH SUDO!"
0016 fi