]> git.plutz.net Git - bootimage/blobdiff - config_elok/etc/rc.local
include custom screensaver, include boot option for remote homes
[bootimage] / config_elok / etc / rc.local
diff --git a/config_elok/etc/rc.local b/config_elok/etc/rc.local
new file mode 100755 (executable)
index 0000000..888b7a5
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+mountdef="$(grep -Eo 'home=[^ ]+' /proc/cmdline)"
+mountdef="${mountdef#home=}"
+mountpath="${mountdef%%;*}"
+mountpath="${mountpath#*://}"
+mounttype="${mountdef%%://*}"
+mountopts="${mountdef#*;}"
+
+macaddr="$(ip address show |grep -Eom1 'link/ether [0-9a-fA-F:]+' |tr : _)"
+macaddr="${macaddr#link/ether }"
+
+[ "$mounttype" = "$mountdef" ] && mounttype=auto
+[ ! "$macaddr" ] && macaddr=noname
+
+if [ "$mountpath" -a "$mountopts" ]; then
+  mount -t "$mounttype" "$mountpath" /home -o "$mountopts"
+elif [ "$mountpath" ]; then
+  mount -t "$mounttype" "$mountpath" /home
+fi
+
+usermod -d "/home/${macaddr}/" guest