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