more script changes

This commit is contained in:
nagumii 2024-11-16 18:18:29 +02:00
parent ce6e8dd649
commit 9232a03832
2 changed files with 7 additions and 32 deletions

View file

@ -1,8 +1,12 @@
echo "*** $(date "+%H:%M:%S %Z"): Starting Femtofox install script ***\e[0m\n"
read -p "Enter your SSID: " SSID
read -sp "Enter your password: " PASSWORD
echo
read -p "Enter wifi SSID: " SSID
echo -n "Enter wifi password: "
stty -echo # Disable terminal echo
read PASSWORD
stty echo # Re-enable terminal echo
echo "*** SSID saved. Wifi requires adapter ***\e[0m\n"
sudo mount -t tmpfs tmpfs /run -o remount,size=32M,nosuid,noexec,relatime,mode=755 #Embiggen tmpfs - prevents problems.
sudo sh -c 'echo "tmpfs /run tmpfs size=32M,nosuid,noexec,relatime,mode=755 0 0" >> /etc/fstab' #Embiggen tmpfs - for future boots.

View file

@ -1,29 +0,0 @@
#!/bin/bash
# Get the current MAC address for eth0
current_mac=$(cat /sys/class/net/eth0/address)
# Define the configuration string to replace
config="# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
# static mac address for onboard ethernet (castellated pins)
allow-hotplug eth0
iface eth0 inet dhcp
hwaddress ether $current_mac
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
"
# Replace the existing configuration for eth0 in /etc/network/interfaces
sudo sed -i "/iface eth0 inet/d" /etc/network/interfaces
echo "$config" | sudo tee /etc/network/interfaces > /dev/null
# Output the current MAC address
echo "*** Replaced /etc/network/interfaces with new MAC address ($current_mac) and wifi support ***\e[0m"