32 lines
1.1 KiB
Plaintext
32 lines
1.1 KiB
Plaintext
#START OF WHIT EDIT
|
|
|
|
updatemacfile=/boot/1st_boot
|
|
if [[ -f "$updatemacfile" ]]; then
|
|
mac=$(cat /sys/class/net/eth0/address \| sed s/://g \| cut -c7-)
|
|
sudo hostname whit$mac
|
|
echo whit$mac \| sudo tee /etc/hostname
|
|
echo 127.0.0.1 localhost \| sudo tee /etc/hosts
|
|
echo ::1 localhost ip6-localhost ip6-loopback \| 'sudo tee -a /etc/hosts
|
|
echo ff02::1 ip6-allnodes \| sudo tee -a /etc/hosts
|
|
echo ff02::2 ip6-allrouters \| sudo tee -a /etc/hosts
|
|
echo \| sudo tee -a /etc/hosts
|
|
echo 127.0.1.1 whit$mac \| sudo tee -a /etc/hosts
|
|
sed -i "s/USER=whit/USER=whit$mac/g" '/home/$USER/config/autostart.sh
|
|
sed -i "s/PASS=whit/PASS=whit$mac/g" /home/$USER/config/autostart.sh
|
|
sed -i "s/export updatehost=whit1/export updatehost=whit$mac/g"
|
|
/home/$USER/config/autostart.sh
|
|
sudo mv /boot/1st_boot /boot/2nd_boot
|
|
#sudo mv /boot/autostart.sh /home/$USER/WHIT/config/
|
|
sudo chown pi /home/$USER/WHIT/config/autostart.sh
|
|
sudo chgrp pi /home/$USER/WHIT/config/autostart.sh
|
|
sudo chmod 777 /home/$USER/WHIT/config/autostart.sh
|
|
sudo reboot
|
|
fi
|
|
|
|
|
|
if [[ "$(tty)" == "/dev/tty1" ]] ; then
|
|
/home/$USER/WHIT/config/autostart.sh
|
|
fi
|
|
|
|
#END OF WHIT EDIT
|