summaryrefslogtreecommitdiffstats
path: root/main/openrc/openrc.post-upgrade
blob: 76c2da75ebfffbc327b13805c8732c0d333fbd30 (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
#!/bin/sh

# in 0.8.0-r1 the state dir moved from /libexec/rc/init.d to /lib/rc/init.d

[ -d /libexec/rc/init.d ] || exit 0

for i in /libexec/rc/init.d/* ; do
	[ -e "$i" ] || continue
	mv $i /lib/rc/init.d/
done

rmdir /libexec/rc/init.d /libexec/rc /libexec 2>/dev/null


# create rc.local compat
if [ -f /etc/rc.local ]; then
	cat >/etc/local.d/rc.local-compat.start<<__EOF__
#!/bin/sh

# this is only here for compatibility reasons
if [ -f /etc/rc.local ]; then
	. /etc/rc.local
fi
__EOF__
	chmod +x /etc/local.d/rc.local-compat.start
fi

exit 0