thinrasp/etc_org/rc.local
2019-11-26 21:36:24 +01:00

12 lines
491 B
Bash
Executable File

#!/bin/bash
service apport stop &
hostname rpi$(sed "s/^.*macaddr=\([0-9A-F:]*\).*$/\1/" /proc/cmdline | tr -d ":") &
hostnamectl set-hostname rpi$(sed "s/^.*macaddr=\([0-9A-F:]*\).*$/\1/" /proc/cmdline | tr -d ":") &
echo rpi$(sed "s/^.*macaddr=\([0-9A-F:]*\).*$/\1/" /proc/cmdline | tr -d ":") > /etc/hostname &
echo 127.0.1.1 rpi$(sed "s/^.*macaddr=\([0-9A-F:]*\).*$/\1/" /proc/cmdline | tr -d ":") >> /etc/hosts &
systemctl disable apt-daily.service
systemctl stop apt-daily.service