summaryrefslogtreecommitdiffstats
path: root/src.etc/init.d/mountdevsubfs
blob: 5f443555fbdc9f620431db84552c6c1bda21ebba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh

start()
{
	printf 'Mounting device file systems... '

	[ -d /dev/pts ] || mkdir -m 0755 /dev/pts
	if ! mount | grep -Fq ' /dev/pts '; then
		mount -t devpts -o noexec,nosuid,gid=5,mode=0620 devpts /dev/pts
	fi

	ln -sf /run/shm /dev/shm

	printf 'done.\n'
}

stop()
{
	printf 'Unmounting device file systems... '

	if mount | grep -Fq ' /dev/pts '; then
		umount /dev/pts
	fi

	printf 'done.\n'
}

case "${1}" in
	start)
		start
		;;
	stop)
		stop
		;;
	*)
		printf 'Usage: %s {start|stop}\n' "${0}" >&2
		exit 1
		;;
esac