summaryrefslogtreecommitdiffstats
path: root/src.etc/init.d/mountdevsubfs
blob: 14e82a37e58dffd3618b1b2d35cebd4ef76d279e (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 -F ' /dev/pts ' >dev/null 2>&1; 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 -F ' /dev/pts ' >dev/null 2>&1; 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