From e2a0cf2a79b43f9f86b74270f3d96fe300687804 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Sat, 20 Jan 2024 12:31:58 -0500 Subject: Cleanup unused files and code. --- linux-bin/wpa | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 linux-bin/wpa (limited to 'linux-bin/wpa') diff --git a/linux-bin/wpa b/linux-bin/wpa new file mode 100755 index 0000000..0ffbc14 --- /dev/null +++ b/linux-bin/wpa @@ -0,0 +1,60 @@ +#!/bin/sh +set -e +# manual configuration of wifi made a little bit easier with wpa_supplicant +session="wpa" +t=3 +interface= +nwid= +wpakey= + +help() { +cat <] [-n ] [-p ] +EOF +exit 1; +} + +while [ $# -gt 0 ] ; do case $1 in + -i|if) interface="$2"; shift ; shift ;; + -n|nwid) nwid="$2"; shift ; shift ;; + -p|wpakey) wpakey="$2"; shift ; shift ;; + *) help ;; +esac ; done + +err=0 +for _v in interface nwid wpakey ; do + eval v="\$$_v"; + if [ -z "$v" ] ; then + echo "$_v cannot be empty" + err=1 + fi +done +if [ $err -eq 1 ] ; then exit 1 ; fi + + +wpakey="$(echo "$wpakey" | sed -e's/"/\\"/g')" + +conf_f="$(mktemp /dev/shm/wpa.XXXX)" +trap 'rm -f $conf_f; exit 1;' EXIT INT +cat > "$conf_f" <