Skip to content

Commit

Permalink
Skip wifi AP setup where unavailable. Add autopeer setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoreeq committed Aug 18, 2020
1 parent 769e9ce commit 883aa2a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions piratemodem-common/files/etc/uci-defaults/13_wifi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh
uci -q get wireless.radio0 > /dev/null || exit 0

# create an isolated network for wireless ygg links
uci -q batch << EOF
Expand Down
11 changes: 9 additions & 2 deletions popura/files/yggdrasil.init
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,24 @@ START=90
STOP=85

USE_PROCD=1
BIN_FILE="/usr/sbin/yggdrasil"
CONFIG_FILE="/tmp/yggdrasil.conf"
DAEMON_OPTS="-useconffile $CONFIG_FILE"

start_service()
{
[ -f /etc/uci-defaults/yggdrasil ] && ( . /etc/uci-defaults/yggdrasil )
# FIXME: Should wait until IPv6 link local addresses are available on br-lan
[ ! -f /tmp/.yggdrasil_started ] && ( touch /tmp/.yggdrasil_started && sleep 7 )

if [ "`uci -q get popura.@popura[0].autopeer`" != "0" ]; then
DAEMON_OPTS="$DAEMON_OPTS -autopeer"
fi
/usr/sbin/ygguci get | $BIN_FILE -useconf -normaliseconf -json > $CONFIG_FILE

procd_open_instance
procd_set_param respawn

procd_set_param command /bin/ash -c "ygguci get | yggdrasil -useconf -normaliseconf -json | yggdrasil -useconf -autopeer"
procd_set_param command $BIN_FILE $DAEMON_OPTS
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
Expand Down

0 comments on commit 883aa2a

Please sign in to comment.