mirror of
https://github.com/YunoHost-Apps/hotspot_ynh.git
synced 2024-09-03 19:25:53 +02:00
fix path for allowed.csv
This commit is contained in:
parent
4eb8febe54
commit
359b6fb9d4
4 changed files with 5 additions and 5 deletions
|
@ -25,7 +25,7 @@ do
|
|||
subnet="${ip6_prefix}1/64"
|
||||
fi
|
||||
|
||||
mac_addresses=$(grep "${prefix}" /etc/hotspot/allowed.csv | cut -d, -f3)
|
||||
mac_addresses=$(grep "${prefix}" /etc/hostapd/$app/allowed.csv | cut -d, -f3)
|
||||
|
||||
# Allow to request 4253 port
|
||||
$iptables_cmd -w -A INPUT -i "${wifi_device}" -m udp -p udp --dport 4253 -j ACCEPT
|
||||
|
|
|
@ -107,7 +107,7 @@ chown root: /etc/hostapd/$app/
|
|||
mkdir -pm 0755 /etc/dnsmasq.$app/
|
||||
chown root: /etc/dnsmasq.$app/
|
||||
|
||||
touch /etc/hotspot/allowed.csv
|
||||
touch /etc/hostapd/$app/allowed.csv
|
||||
|
||||
# Copy init script
|
||||
ynh_add_config --template="../conf/ynh-hotspot" --destination="/usr/local/bin/$service_name"
|
||||
|
|
|
@ -166,7 +166,7 @@ chown root: /etc/hostapd/$app/
|
|||
mkdir -pm 0755 /etc/dnsmasq.$app/
|
||||
chown root: /etc/dnsmasq.$app/
|
||||
|
||||
touch /etc/hotspot/allowed.csv
|
||||
touch /etc/hostapd/$app/allowed.csv
|
||||
|
||||
if [[ -n "${wifi_device:-}" ]]; then
|
||||
configure_hostapd
|
||||
|
|
|
@ -4,8 +4,8 @@ date=$(date +"%Y-%m-%d %T")
|
|||
ip=$1
|
||||
mac=$(arp -a $ip | cut -d" " -f4 | head -n1)
|
||||
interface=$(grep wifi_device /etc/yunohost/apps/hotspot/settings.yml | cut -d: -f2 | sed "s/[ ']//g")
|
||||
if ! grep $mac /etc/hotspot/allowed.csv ; then
|
||||
echo "$date,$ip,$mac" >> /etc/hotspot/allowed.csv
|
||||
if ! grep $mac /etc/hostapd/$app/allowed.csv ; then
|
||||
echo "$date,$ip,$mac" >> /etc/hostapd/$app/allowed.csv
|
||||
iptables -w -I hotspot_fwd 1 -s $ip -m mac --mac-source $mac -j ACCEPT
|
||||
iptables -t nat -w -I PREROUTING 1 -i $interface -s $ip -m mac --mac-source $mac -j ACCEPT
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue