@@ -69,6 +69,14 @@ function remote {
6969 log_and_exit1 " Usage: $BASENAME remote commands [json]"
7070 fi
7171 ;;
72+ " reverse" )
73+ checkargn $# 2
74+ reverse=$( internet reverse | sed -e ' s#",\ "#"\n"#g' | cut -d' "' -f4)
75+ while IFS= read -r line; do
76+ cmd_str+=" \" $line \" ,"
77+ done <<< " $reverse"
78+ printf " [%s]\n" " ${cmd_str::- 1} "
79+ ;;
7280 " allservices" )
7381 checkargn $# 1
7482 json_fmt=" {\" available\" :[" %s" ],\" installed\" :[" %s" ],\" running\" :[" %s" ],\" icon\" :{" %s" },\" info\" :{" %s" },\" autorun\" :{" %s" },\" usesEnv\" :{" %s" },\" size\" :{" %s" }}\n"
@@ -168,7 +176,7 @@ function remote {
168176 ;;
169177 * )
170178 echo " Unknown command option"
171- echo " Usage: $BASENAME remote <check | status | upgrade | services | version | commands | allservices | statuspage | ssh2fa | help | key>"
179+ echo " Usage: $BASENAME remote <check | status | upgrade | services | version | commands | reverse | allservices | statuspage | ssh2fa | help | key>"
172180 ;;
173181 esac
174182}
@@ -194,7 +202,7 @@ function autorun_helper {
194202
195203function remote_help {
196204 echo
197- echo " Usage: $BASENAME remote <check | status | upgrade | services | version | commands | allservices | statuspage | ssh2fa | help | key>"
205+ echo " Usage: $BASENAME remote <check | status | upgrade | services | version | commands | reverse | allservices | statuspage | ssh2fa | help | key>"
198206 echo
199207 echo " Returns a string representation of the current status of the Raspberry Pi"
200208 echo " Used for Treehouses Remote"
@@ -230,6 +238,9 @@ function remote_help {
230238 echo " $BASENAME remote commands [json]"
231239 echo " returns a list of all commands for tab completion"
232240 echo
241+ echo " $BASENAME remote reverse"
242+ echo " returns the device's internet location information"
243+ echo
233244 echo " $BASENAME remote allservices"
234245 echo " returns json string of services"
235246 echo
0 commit comments