]> git.plutz.net Git - bootimage/blob - config_elok/etc/rc.local
include custom screensaver, include boot option for remote homes
[bootimage] / config_elok / etc / rc.local
1 #!/bin/sh
2
3 mountdef="$(grep -Eo 'home=[^ ]+' /proc/cmdline)"
4 mountdef="${mountdef#home=}"
5 mountpath="${mountdef%%;*}"
6 mountpath="${mountpath#*://}"
7 mounttype="${mountdef%%://*}"
8 mountopts="${mountdef#*;}"
9
10 macaddr="$(ip address show |grep -Eom1 'link/ether [0-9a-fA-F:]+' |tr : _)"
11 macaddr="${macaddr#link/ether }"
12
13 [ "$mounttype" = "$mountdef" ] && mounttype=auto
14 [ ! "$macaddr" ] && macaddr=noname
15
16 if [ "$mountpath" -a "$mountopts" ]; then
17   mount -t "$mounttype" "$mountpath" /home -o "$mountopts"
18 elif [ "$mountpath" ]; then
19   mount -t "$mounttype" "$mountpath" /home
20 fi
21
22 usermod -d "/home/${macaddr}/" guest