mirror of
https://github.com/CopterExpress/clover.git
synced 2026-05-29 22:39:33 +00:00
image_builder: edit to HW setup at init script
This commit is contained in:
@@ -28,4 +28,8 @@ echo "$1" >> /etc/clever_version
|
||||
# Origin image file name
|
||||
echo "${2%.*}" >> /etc/clever_origin
|
||||
|
||||
echo -e "\033[0;31m\033[1m$(date) | #3 End initialisation of image\033[0m\033[0m"
|
||||
echo -e "\033[0;31m\033[1m$(date) | #1 Write magic script to /etc/rc.local\033[0m\033[0m"
|
||||
MAGIC_SCRIPT="sudo /root/init_rpi.sh && sudo sed -i '/sudo \/root\/init_rpi.sh/d' /etc/rc.local && sudo reboot"
|
||||
sed -i "19a${MAGIC_SCRIPT}" /etc/rc.local
|
||||
|
||||
echo -e "\033[0;31m\033[1m$(date) | #3 End initialisation of image\033[0m\033[0m"
|
||||
9
image_builder/scripts/init_rpi.sh
Executable file
9
image_builder/scripts/init_rpi.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo -e "\033[0;31m\033[1m$(date) | #1 Rename SSID\033[0m\033[0m"
|
||||
sudo sed -i.OLD "s/CLEVER/CLEVER-$(head -c 100 /dev/urandom | xxd -ps -c 100 | sed -e 's/[^0-9]//g' | cut -c 1-4)/g" /etc/wpa_supplicant/wpa_supplicant.conf
|
||||
|
||||
echo -e "\033[0;31m\033[1m$(date) | #2 Harware setup\033[0m\033[0m"
|
||||
/root/hardware_setup.sh
|
||||
|
||||
echo -e "\033[0;31m\033[1m$(date) | #3 End of network installation\033[0m\033[0m"
|
||||
@@ -36,10 +36,8 @@ domain-needed
|
||||
quiet-dhcp6
|
||||
" >> /etc/dnsmasq.conf
|
||||
|
||||
echo -e "\033[0;31m\033[1m$(date) | #4 Write magic script for rename SSID to /etc/rc.local\033[0m\033[0m"
|
||||
|
||||
RENAME_SSID="sudo sed -i.OLD \"s/CLEVER/CLEVER-\$(head -c 100 /dev/urandom | xxd -ps -c 100 | sed -e 's/[^0-9]//g' | cut -c 1-4)/g\" /etc/wpa_supplicant/wpa_supplicant.conf && sudo sed -i '/sudo sed/d' /etc/rc.local && sudo reboot"
|
||||
|
||||
sed -i "19a$RENAME_SSID" /etc/rc.local
|
||||
#echo -e "\033[0;31m\033[1m$(date) | #4 Write magic script for rename SSID to /etc/rc.local\033[0m\033[0m"
|
||||
#RENAME_SSID="sudo sed -i.OLD \"s/CLEVER/CLEVER-\$(head -c 100 /dev/urandom | xxd -ps -c 100 | sed -e 's/[^0-9]//g' | cut -c 1-4)/g\" /etc/wpa_supplicant/wpa_supplicant.conf && sudo sed -i '/sudo sed/d' /etc/rc.local && sudo reboot"
|
||||
#sed -i "19a$RENAME_SSID" /etc/rc.local
|
||||
|
||||
echo -e "\033[0;31m\033[1m$(date) | #5 End of network installation\033[0m\033[0m"
|
||||
|
||||
Reference in New Issue
Block a user