TOR first, fixed when OFF, small tweaks

This commit is contained in:
kexkey
2019-11-08 16:50:54 -05:00
committed by kexkey
parent 58b80e1d3b
commit 96f6301282
8 changed files with 43 additions and 36 deletions

View File

@@ -79,8 +79,12 @@ main() {
installation_info)
# GET http://192.168.111.152:8080/info
if [ -f "$DB_PATH/info.json" ]; then
# Replace tor_hostname_placeholder with actual tor hostname from tor file
response=$(sed "s/tor_hostname_placeholder/`tr -d '\n\r' < tor/hidden_service/hostname`/g" "$DB_PATH/info.json")
if [ -f "tor/hidden_service/hostname" ]; then
# Replace tor_hostname_placeholder with actual tor hostname from tor file
response=$(sed "s/tor_hostname_placeholder/`tr -d '\n\r' < tor/hidden_service/hostname`/g" "$DB_PATH/info.json")
else
response=$(cat "$DB_PATH/info.json")
fi
else
response='{ "error": "missing installation data" }'
fi