Skip to content

Commit

Permalink
fix: launch correct script
Browse files Browse the repository at this point in the history
josegonzalez authored Jan 12, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent adad4e3 commit 989de10
Showing 1 changed file with 1 addition and 41 deletions.
42 changes: 1 addition & 41 deletions launch.sh
Original file line number Diff line number Diff line change
@@ -6,44 +6,4 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$progdir/lib"
echo 1 >/tmp/stay_awake
trap "rm -f /tmp/stay_awake" EXIT INT TERM HUP QUIT

wifi_off() {
echo "Preparping to toggle wifi off..."

if pgrep wpa_supplicant; then
echo "Stopping wpa_supplicant..."
killall -9 wpa_supplicant || true
fi

status="$(cat /sys/class/net/wlan0/carrier)"
if [ "$status" = 1 ]; then
echo "Marking wlan0 interface down..."
ifconfig wlan0 down || true
fi

if [ ! -f /sys/class/rfkill/rfkill0/state ]; then
echo "Blocking wireless..."
echo 0 >/sys/class/rfkill/rfkill0/state || true
fi
}

wifi_on() {
echo "Preparing to toggle wifi on..."

echo "Unblocking wireless..."
echo 1 >/sys/class/rfkill/rfkill0/state || true

echo "Starting wpa_supplicant..."
wpa_supplicant -B -D nl80211 -iwlan0 -c /etc/wifi/wpa_supplicant.conf -O /etc/wifi/sockets || true
( (udhcpc -i wlan0 &) &)
}

if pgrep wpa_supplicant; then
wifi_off
else
wifi_on
fi

echo "Done toggling wifi!"
echo ""
echo "Sleeping for 2 seconds."
sleep 2
/usr/trimui/apps/fn_editor/launch.sh

0 comments on commit 989de10

Please sign in to comment.