Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wifischedule: fix startup problems #22974

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions net/wifischedule/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=wifischedule
PKG_VERSION:=1.0.5
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_LICENSE:=PRPL

PKG_MAINTAINER:=Nils Koenig <[email protected]>
Expand Down Expand Up @@ -54,7 +54,7 @@ define Package/wifischedule/install
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DATA) ./net/etc/config/wifi_schedule $(1)/etc/config/wifi_schedule
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DATA) ./net/etc/init.d/wifi_schedule $(1)/etc/init.d/wifi_schedule
$(INSTALL_BIN) ./net/etc/init.d/wifi_schedule $(1)/etc/init.d/wifi_schedule
endef

define Package/wifischedule/postinst
Expand Down
18 changes: 10 additions & 8 deletions net/wifischedule/net/usr/bin/wifi_schedule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,16 @@ _should_wifi_enabled()
startup()
{
_log "startup"
local _enable_wifi=$(_should_wifi_enabled)
if [[ ${_enable_wifi} -eq 0 ]]
then
_log "enable wifi"
enable_wifi
else
_log "disable wifi"
disable_wifi
local global_enabled=$(_get_uci_value ${GLOBAL}.enabled) || _exit 1
if [ ${global_enabled} -eq 1 ]; then
local _enable_wifi=$(_should_wifi_enabled)
if [ ${_enable_wifi} -eq 0 ]; then
_log "enable wifi"
enable_wifi
else
_log "disable wifi"
disable_wifi
fi
fi
}

Expand Down