about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJuan RP <xtraeme@voidlinux.eu>2015-06-03 07:51:41 +0200
committerJuan RP <xtraeme@voidlinux.eu>2015-06-03 07:51:41 +0200
commit95e7eb7afe216b576c627aec8010c34b27555e13 (patch)
tree76815dac4c3745800fa6787c4abf044b2c417da3
parent55ecf2f18851e3cf9d2b8017701aa882e0b23a6d (diff)
downloadrunit-void-95e7eb7afe216b576c627aec8010c34b27555e13.tar.gz
runit-void-95e7eb7afe216b576c627aec8010c34b27555e13.tar.xz
runit-void-95e7eb7afe216b576c627aec8010c34b27555e13.zip
Added core-services/98-sbin-merge scriptlet to create usr/sbin symlink. 20150603
This checks if /usr/sbin is a real directory and then moves it to
/usr/sbin.old if there are only symlinks, and then the /usr/sbin -> /usr/bin
symlink is created.
-rw-r--r--core-services/98-sbin-merge.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/core-services/98-sbin-merge.sh b/core-services/98-sbin-merge.sh
new file mode 100644
index 0000000..df8629f
--- /dev/null
+++ b/core-services/98-sbin-merge.sh
@@ -0,0 +1,11 @@
+if [ -d /usr/sbin -a ! -L /usr/sbin ]; then
+	for f in /usr/sbin/*; do
+		if [ -f $f -a ! -L $f ]; then
+			msg "Detected $f file, can't create /usr/sbin symlink."
+			return 0
+		fi
+	done
+	msg "Creating /usr/sbin -> /usr/bin symlink, moving existing to /usr/sbin.old"
+	mv /usr/sbin /usr/sbin.old
+	ln -sf bin /usr/sbin
+fi