File: addrconsole

package info (click to toggle)
remote-tty 4.0-13
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, sid, stretch, wheezy
  • size: 212 kB
  • ctags: 219
  • sloc: ansic: 2,100; sh: 340; makefile: 131
file content (21 lines) | stat: -rw-r--r-- 564 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

echo -n "Username                       : "
read USERNAME

echo -n "Serial port (no need for /dev/): "
read PORT

ln -s /dev/$PORT /etc/remote-tty/dev/$USERNAME

echo "rttymgr:$USERNAME" > /etc/remote-tty/owner/$USERNAME.sock

adduser --home /var/log/remote-tty/$USERNAME \
	--gecos "$USERNAME Serial Console" $USERNAME
chsh -s /usr/bin/rconsole-user $USERNAME
addgroup rttymgr $USERNAME
chown $USERNAME:rttymgr /var/log/remote-tty/$USERNAME
chmod 775 /var/log/remote-tty/$USERNAME

cd /etc/remote-tty/dev
su - rttymgr -c "/usr/sbin/startsrv $USERNAME"