From c69d4eb035a06e6ee1d006e4fcbdd36637e17037 Mon Sep 17 00:00:00 2001 From: ache Date: Mon, 15 Jan 2018 05:14:27 +0100 Subject: Fix tethapp --- tethapp.sh | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/tethapp.sh b/tethapp.sh index 3d859d8..ed0e61f 100755 --- a/tethapp.sh +++ b/tethapp.sh @@ -76,16 +76,23 @@ echo "Configuration de DNSQMASQ" cat <<< $( echo " - interface=${interface} - listen-address=${ip} - bind-interfaces - dhcp-range=${dhcp_range}" -) > /tmp/dnsmasq.conf +address=/#/${ip} +listen-address=${ip} +interface=${interface} +#bind-interfaces +dhcp-range=${dhcp_range}" +) > /tmp/dnsmasq_hotspot.conf echo 'Lancement de DNSMASQ (DHCP sur le réseau 10.5.5.0/24)' -sudo dnsmasq --conf-file=/tmp/dnsmasq.conf +if sudo dnsmasq --conf-file=/tmp/dnsmasq_hotspot.conf ; then + echo 'Ok dnsmasq prêt' +else + echo 'Erreur : Impossible de démarrer dnsmasq' + echo 'Abandon' + exit 1 +fi echo "Activation de l'interface ${interface}" sudo ip link set "${interface}" up @@ -162,12 +169,20 @@ eap_server=0" echo "Lancement du hostpot Wifi" -sudo hostapd /tmp/hostapd.conf +if sudo hostapd /tmp/hostapd.conf ; then + echo 'Yeah, i wish you enjoyed it' +else + echo 'Error: there is a problem with hostapd' +fi echo 'Clean des iptables' sudo iptables --flush sudo iptables -t nat --flush +echo 'Clean config' + +rm /tmp/dnsmasq_hotspot.conf /tmp/hostapd.conf + echo 'Bye 💋' echo 'Have a nice day <3' -- cgit v1.2.3