pastebin - collaborative debugging tool
kpaste.net RSS


Untitled
Posted by Anonymous on Wed 31st Aug 2016 00:46
raw | new post
modification of post by Anonymous (view diff)

  1. #!/system/bin/sh
  2. export PATH=/system/xbin:$PATH
  3. IP="$(ip -f inet addr show wlan0 | awk -F'(/|[[:space:]]+)' '/inet / {print $3}')"
  4. PID="$(pidof dropbear)"
  5.  
  6. echo IP: $IP
  7. echo PID: $PID
  8.  
  9. if [ -n "$IP" ]; then
  10.         echo IP Check Succeeded
  11.         if [ -z "$PID" ]; then
  12.                 echo PID Check Succeeded: dropbear not running
  13.                 busybox nice -n -5 /data/dropbear/dropbear -A -N root -C '<somepassword>' -T /data/dropbear/authorized_keys -U 0 -G 0 -r /data/dropbear/dropbear_rsa_host_key -p 22 -e
  14.                 return="$?"
  15.                 if [ "$return" -ne "0" ]; then
  16.                         echo "dropbear failed to start ($return)"
  17.                 else
  18.                         echo dropbear started
  19.                 fi
  20.         else
  21.                 echo dropbear already running: nothing to do
  22.         fi
  23. else
  24.         echo IP Check failed
  25.         if [ -n "$PID" ]; then
  26.                 echo PID Check Succeeded: killing dropbear
  27.                 killall dropbear
  28.                 sleep 5
  29.                 killall -9 dropbear
  30.                 echo dropbear killed
  31.         else
  32.                 echo dropbear not running: nothing to do
  33.         fi
  34. fi

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at