eiwd: add back iwd_passphrase

This commit is contained in:
Dylan Araps 2021-07-19 12:57:42 +03:00
parent e78fc2f7d9
commit 47499b1261
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C
4 changed files with 38 additions and 0 deletions

View File

@ -9,6 +9,8 @@
make
make install
cp -f iwd_passphrase "$1/usr/bin"
# Install runit service.
mkdir -p "$1/etc/sv/eiwd"
cp -f eiwd.run "$1/etc/sv/eiwd/run"

View File

@ -1,2 +1,3 @@
3f0ceb79c662050325034dcd8a7b5cdf0d7e80560b65ca5f16bce7e115247a8e
9798194395fbc26a1ad8465bab7ac9c9e94c3a51edaf5987a414037c34169e63
bf22ccc74ff06d56f8525e3d41361eb413de56e5eaccbf9cfdfb1bf5491dbf40

34
extra/eiwd/files/iwd_passphrase Executable file
View File

@ -0,0 +1,34 @@
#!/bin/sh
#
# Simple script to generate iwd network files.
[ "$1" ] || {
printf '%s\n' "usage: printf pass | ${0##*/} ssid" >&2
exit 1
}
# Read the password from 'stdin'.
read -r pass; [ "$pass" ] || exit 1
# Consider all characters as single-byte.
export LC_CTYPE=C
# The SSID appears verbatim in the name if it contains
# only alphanumeric characters, spaces, underscores or
# minus signs. Otherwise it is encoded as an equal sign
# followed by the lower-case hex encoding of the name.
case $1 in
*[!A-Za-z0-9_' '-]*)
ssid="=$(printf %s "$1" | od -vA n -t x1 | tr -d '\n ')"
;;
*)
ssid=$1
;;
esac
printf '%s\n\n' "Save this output to /var/lib/iwd/$ssid.psk" >&2
printf '[Security]\n'
printf 'Passphrase=%s\n' "$pass"
printf '\nTIP: You can use this output directly as the\n' >&2
printf ' help messages are printed to stderr.\n' >&2

View File

@ -1,2 +1,3 @@
https://github.com/illiliti/eiwd/releases/download/VERSION-1/iwd-MAJOR.MINOR.tar.xz
files/eiwd.run
files/iwd_passphrase