Skip to content

Commit

Permalink
treehouses remote reverse key value (fixes #2128) (#2130)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <dogi@users.noreply.github.com>
  • Loading branch information
JLKwong and dogi authored Mar 25, 2021
1 parent 9dbd0d2 commit f5397e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions modules/remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function remote {
;;
"reverse")
checkargn $# 2
reverse=$(internet reverse | sed -e 's#",\ "#"\n"#g' | cut -d'"' -f4)
reverse=$(internet reverse | sed -e 's#",\ "#"\n"#g' | cut -d'"' -f 2,3,4 | sed 's#\:[[:space:]]\"#:\"#g')
while IFS= read -r line; do
cmd_str+="\"$line\","
done <<< "$reverse"
Expand Down Expand Up @@ -99,8 +99,8 @@ function remote {
printf "$json_fmt" "$available_str" "$installed_str" "$running_str" "${icon_str::-1}" "${info_str::-1}" "${autorun_str::-1}" "${env_str::-1}" "${size_str::-1}"
;;
"statuspage")
countryonly=$(wificountry)
checkargn $# 1
countryonly=$(wificountry)
checkargn $# 1
json_statusfmt="{\"status\":\"$(remote status)\",\"hostname\":\"$(hostname)\",\"arm\":\"$(detect arm)\",\"internet\":\"$(internet)\",\"memory_total\":\"$(memory total gb)\",\"memory_used\":\"$(memory used gb)\",\"temperature\":\"$(temperature)\",\"networkmode\":\"$(networkmode)\",\"info\":\"$(networkmode info | tr '\n' ' ')\",\"storage\":\"$(system disk | tr '\n' ' ' | sed 's/^[[:space:]]*//;s/ \{1,\}/ /g;s/[[:space:]]*$//')\",\"wificountry\":\"${countryonly:8}\"}"

printf '%s\n' "${json_statusfmt}"
Expand Down Expand Up @@ -141,7 +141,6 @@ function remote {
send)
checkargn $# 3
profile=$3

public_key=$(sshtunnel key send public $profile)
private_key=$(sshtunnel key send private $profile | tr '\n' ' ')

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@treehouses/cli",
"version": "1.25.32",
"version": "1.25.33",
"remote": "4000",
"description": "Thin command-line interface for Raspberry Pi low level configuration.",
"main": "cli.sh",
Expand Down

0 comments on commit f5397e2

Please sign in to comment.