examples/var_service/supplicant_if: new service example
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
92d98f0612
commit
d8330ca4a4
5
examples/var_service/supplicant_if/README
Normal file
5
examples/var_service/supplicant_if/README
Normal file
@ -0,0 +1,5 @@
|
||||
The real README file is one directory up.
|
||||
|
||||
This directory's run script can have useful comments.
|
||||
If it doesn't but you feel it should, please send a patch
|
||||
to busybox's mailing list.
|
21
examples/var_service/supplicant_if/log/run
Executable file
21
examples/var_service/supplicant_if/log/run
Executable file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
user=logger
|
||||
|
||||
logdir="/var/log/service/`(cd ..;basename $PWD)`"
|
||||
mkdir -p "$logdir" 2>/dev/null
|
||||
chown -R "$user": "$logdir"
|
||||
chmod -R go-rwxst,u+rwX "$logdir"
|
||||
rm -rf logdir
|
||||
ln -s "$logdir" logdir
|
||||
|
||||
# make this dir accessible to logger
|
||||
chmod a+rX .
|
||||
|
||||
exec >/dev/null
|
||||
exec 2>&1
|
||||
exec \
|
||||
env - PATH="$PATH" \
|
||||
softlimit \
|
||||
setuidgid "$user" \
|
||||
svlogd -tt "$logdir"
|
4
examples/var_service/supplicant_if/p_log
Executable file
4
examples/var_service/supplicant_if/p_log
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd log/logdir || exit 1
|
||||
cat @* current | $PAGER
|
21
examples/var_service/supplicant_if/run
Executable file
21
examples/var_service/supplicant_if/run
Executable file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
exec 2>&1
|
||||
exec </dev/null
|
||||
|
||||
pwd="$PWD"
|
||||
|
||||
if="${PWD##*/dhcp_}"
|
||||
|
||||
echo "* Upping iface $if"
|
||||
ip link set dev "$if" up
|
||||
|
||||
##echo "* Powersave disable on $if"
|
||||
##iw dev "$if" set power_save off
|
||||
|
||||
echo "* Starting wpa_supplicant"
|
||||
exec \
|
||||
env - PATH="$PATH" \
|
||||
softlimit \
|
||||
setuidgid root \
|
||||
wpa_supplicant -i "$if" -c "$pwd/wpa_supplicant.conf" -d
|
4
examples/var_service/supplicant_if/w_log
Executable file
4
examples/var_service/supplicant_if/w_log
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd log/logdir || exit 1
|
||||
watch -n2 'w=`ttysize w`; h=`ttysize h`; tail -$((h-3)) current 2>&1 | cut -b1-$((w-2))'
|
28
examples/var_service/supplicant_if/wpa_supplicant.conf
Normal file
28
examples/var_service/supplicant_if/wpa_supplicant.conf
Normal file
@ -0,0 +1,28 @@
|
||||
# allow frontend (e.g., wpa_cli) to be used by all users in 'wheel' group
|
||||
ctrl_interface=DIR=/var/run/wpa_supplicant
|
||||
#GROUP=wheel
|
||||
|
||||
# Typical minimal wifi setup:
|
||||
network={
|
||||
ssid="--your-ESSID--"
|
||||
key_mgmt=WPA-PSK
|
||||
psk="--your-password--"
|
||||
}
|
||||
|
||||
# Other fields:
|
||||
# scan_ssid=1
|
||||
# key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
|
||||
# pairwise=CCMP TKIP
|
||||
# group=CCMP TKIP WEP104 WEP40
|
||||
# psk="very secret passphrase"
|
||||
# eap=TTLS PEAP TLS
|
||||
# identity="user@example.com"
|
||||
# ca_cert="/etc/cert/ca.pem"
|
||||
# client_cert="/etc/cert/user.pem"
|
||||
# private_key="/etc/cert/user.prv"
|
||||
# private_key_passwd="password"
|
||||
# phase1="peaplabel=0"
|
||||
# ca_cert2="/etc/cert/ca2.pem"
|
||||
# client_cert2="/etc/cer/user.pem"
|
||||
# private_key2="/etc/cer/user.prv"
|
||||
# private_key2_passwd="password"
|
Loading…
Reference in New Issue
Block a user