Skip to content

Instantly share code, notes, and snippets.

@aarobc
Created May 21, 2017 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aarobc/9e3adb58adae0e528f4ee2c5b0d2e350 to your computer and use it in GitHub Desktop.
Save aarobc/9e3adb58adae0e528f4ee2c5b0d2e350 to your computer and use it in GitHub Desktop.
#!/bin/bash
cmd="am startservice \
-n com.google.wifisetup/.WifiSetupService \
-a WifiSetupService.Connect \
-e ssid '$1' \
-e passphrase '$2'"
echo $cmd
sesh=`screen -list | grep "Attached" | awk '{print $1;}'`
echo $sesh
screen -S $sesh -X stuff "$cmd^M"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment