From 028d0520cffa46bdd4187ef9f19fcd249bedbc95 Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Sun, 23 Apr 2017 11:30:52 +0200 Subject: [PATCH] wifi-reload: Initial version. --- G/G | 2 +- Makefile | 8 +++--- pdfman/pdfman | 7 +++-- wifi-reload/wifi-reload | 64 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 7 deletions(-) create mode 100755 wifi-reload/wifi-reload diff --git a/G/G b/G/G index 296c3cf..8193290 100755 --- a/G/G +++ b/G/G @@ -4,7 +4,7 @@ =head1 NAME -G - short hand for multi level greps +G - shorthand for multi level greps =head1 SYNOPSIS diff --git a/Makefile b/Makefile index 37e0f05..e96cb7b 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ -CMD = blink bsearch em G gitnext goodpasswd histogram neno pdfman \ -puniq ramusage rand rclean rn rrm stdout T timestamp tracefile \ -upsidedown wssh +CMD = blink bsearch em field forever G gitnext goodpasswd histogram \ +neno pdfman puniq ramusage rand rclean rn rrm stdout T timestamp \ +tracefile upsidedown w4it-for-port-open wifi-reload wssh -all: blink/blink.1 bsearch/bsearch.1 G/G.1 gitnext/gitnext.1 goodpasswd/goodpasswd.1 histogram/histogram.1 neno/neno.1 pdfman/pdfman.1 puniq/puniq.1 rand/rand.1 rn/rn.1 rrm/rrm.1 stdout/stdout.1 timestamp/timestamp.1 tracefile/tracefile.1 T/T.1 upsidedown/upsidedown.1 wssh/wssh.1 +all: blink/blink.1 bsearch/bsearch.1 G/G.1 gitnext/gitnext.1 goodpasswd/goodpasswd.1 histogram/histogram.1 neno/neno.1 pdfman/pdfman.1 puniq/puniq.1 rand/rand.1 rn/rn.1 rrm/rrm.1 stdout/stdout.1 timestamp/timestamp.1 tracefile/tracefile.1 T/T.1 upsidedown/upsidedown.1 wifi-reload/wifi-reload.1 wssh/wssh.1 %.1: % pod2man $< > $@ diff --git a/pdfman/pdfman b/pdfman/pdfman index 49f85ad..ed367c6 100755 --- a/pdfman/pdfman +++ b/pdfman/pdfman @@ -115,8 +115,11 @@ else fi -man -w "$@" | parallel 'zcat {} || cat {}' 2>/dev/null | +man -w "$@" | + parallel 'zcat {} || cat {}' 2>/dev/null | # Convert -- to - and '' to " (echo '.tr \--'; perl -pe "s/''|\`\`/\"\"/g;") | - man -tl - | ps2pdf - >$pdf && pdfviewer $pdf + man -tl - | + perl -pe "s/'/\\\\010/g" | + ps2pdf - >$pdf && pdfviewer $pdf cleanup 2>/dev/null diff --git a/wifi-reload/wifi-reload b/wifi-reload/wifi-reload new file mode 100755 index 0000000..0f6c357 --- /dev/null +++ b/wifi-reload/wifi-reload @@ -0,0 +1,64 @@ +#!/bin/bash + +: <<=cut +=encoding utf8 + +=head1 NAME + +wifi-reload - reload wifi setup + + +=head1 SYNOPSIS + +B + + +=head1 DESCRIPTION + +Sometimes the wifi config gets stuck. B tries to get the +config unstuck by reloading modules, wpa_supplicant and +NetworkManager. + + +=head1 AUTHOR + +Copyright (C) 2017 Ole Tange, +http://ole.tange.dk and Free Software Foundation, Inc. + + +=head1 LICENSE + +Copyright (C) 2012 Free Software Foundation, Inc. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +at your option any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + + +=head1 SEE ALSO + +B(1) + + +=cut + +sudo killall wpa_supplicant +sudo parallel -j1 modprobe -r ::: iwldvm ath9k ath9k_common mac80211 ath9k_hw ath cfg80211 ath3k +sleep 1 +sudo killall -9 wpa_supplicant +parallel -j1 sudo modprobe ::: ath9k ath9k_common mac80211 ath9k_hw ath cfg80211 ath3k iwldvm +PID=$(sudo NetworkManager 2>&1 | grep -Eo '[0-9]+') +sudo kill $PID || sudo killall NetworkManager +sleep 1 +sudo kill -9 $PID +sudo NetworkManager & +forever dmesg | puniq