Init v1.0

This commit is contained in:
2023-04-30 20:16:33 +02:00
parent 69ed0d5e65
commit 048198ccbe
15 changed files with 923 additions and 58 deletions
+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
if [ -f /boot/hostapd.conf ]; then
fs_mode=$(mount | sed -n -e "s/^.* on \/ .*(\(r[w|o]\).*/\1/p")
if [ "$fs_mode" != "rw" ]; then
mount -o remount,rw /
fi
cat /boot/hostapd.conf > /etc/hostapd/hostapd.conf
cp /etc/dhcpcd.conf_hotspot /etc/dhcpcd.conf
cp /etc/default/hostapd_hotspot /etc/default/hostapd
rm /boot/hostapd.conf
if ! (($?)); then
/sbin/reboot
exit 0
fi
fi
# Si l'utilisateur à déposé un fichier wpa_supplicant.conf dans boot
if [ -f /boot/wpa_supplicant.conf ]; then
fs_mode=$(mount | sed -n -e "s/^.* on \/ .*(\(r[w|o]\).*/\1/p")
if [ "$fs_mode" != "rw" ]; then
mount -o remount,rw /
fi
cp /etc/dhcpcd.conf_box /etc/dhcpcd.conf
cp /etc/default/hostapd_box /etc/default/hostapd
cat /boot/wpa_supplicant.conf > /etc/wpa_supplicant/wpa_supplicant.conf
rm /boot/wpa_supplicant.conf
if ! (($?)); then
/sbin/reboot
fi
fi
+29
View File
@@ -0,0 +1,29 @@
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
if [ -f /opt/banc/tools/img-wpa_supplicant.sh ]; then
/bin/bash /opt/banc/tools/img-wpa_supplicant.sh
fi
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
touch /tmp/star-menu-first-launch
screen -A -m -d -S start-menu /opt/banc/start-menu.sh
if [ -x /opt/ttyd ]; then
/opt/ttyd -p 8022 /opt/banc/start-ttyd.sh > /tmp/ttyd.log 2>/tmp/ttyd-error.log &
fi
exit 0