aboutsummaryrefslogtreecommitdiffstats
path: root/main/alpine-baselayout/alpine-baselayout.pre-upgrade
blob: 2fcbe179436ecd748282edf2ab4b0019e14a90e5 (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
#!/bin/sh

# we need to have our modprobe.d files with .conf suffix
for i in /etc/modprobe.d/*; do
	# ignore files that does not exist (i.e if modprobe.d is empty)
	[ -r "$i" ] || continue

	# ignore files that have an extension
	case "$i" in
		*.*) continue;;
	esac

	# append extension
	mv "$i" "$i".conf
done

# migrate /var/run directory to /run
if [ -d /var/run ]; then
	cp -a /var/run/* /run 2>/dev/null
	rm -rf /var/run
	ln -s ../run /var/run
fi

# migrate /var/spool/mail directory to /var/mail
if [ -d /var/spool/mail ]; then
	mkdir -p /var/mail
	cp -a /var/spool/mail/* /var/mail/ 2>/dev/null
	rm -rf /var/spool/mail
	ln -s ../mail /var/spool/mail
fi
addgroup -S -g 42 shadow 2>/dev/null

exit 0