cat /sys/class/power_supply/bd7181x_bat/capacity
ntpdate -u time.apple.com && hwclock -w
#!/bin/sh | |
# WiFi interface name | |
INTERFACE="wlan0" | |
# Path to the operstate file | |
OPERSTATE="/sys/class/net/$INTERFACE/operstate" | |
# WiFi ESSID | |
WIFIESSID="ASUS_E8_2G" | |
# Check if the interface exists | |
if [ ! -f "$OPERSTATE" ]; then | |
echo "WiFi interface $INTERFACE does not exist" | |
exit 1 | |
fi | |
# Read operstate content | |
STATE=$(cat "$OPERSTATE") | |
# Check if the state is up | |
if [ "$STATE" != "up" ]; then | |
echo "WiFi not connected (state: $STATE), try connecting to $WIFIESSID" | |
lipc-set-prop com.lab126.wifid cmConnect "$WIFIESSID" | |
else | |
echo "WiFi connected (state: $STATE)" | |
fi | |
exit 0 |
lipc-get-prop com.lab126.wifid profileCount
echo "{index=(0)}" | lipc-hash-prop com.lab126.wifid profileData
lipc-set-prop com.lab126.wifid deleteProfile WIFIESSID
echo '{essid="WIFIESSID", smethod="wpa2", secured="yes", psk="WIFIPSK"}' | lipc-hash-prop com.lab126.wifid createProfile
smethod can be one of open,wep,wpa,wpa2 (if you choose open, set secured to “no”)
WIFIPSK is the WIFI PSK as generated with the wpa_passphrase utility (which is actually on the kindle): a normal “wifi passphrase” will not work.
lipc-set-prop com.lab126.wifid cmConnect WIFIESSID
echo "{index = (0)}" | lipc-hash-prop -n com.lab126.wifid currentEssid