Show local trove details within About

This commit is contained in:
Bob Mottram 2016-01-27 12:11:58 +00:00
parent 3e90015ce1
commit 9d04bf3043
1 changed files with 22 additions and 0 deletions

View File

@ -47,6 +47,8 @@ MINIMUM_PASSWORD_LENGTH=8
VOIP_PORT=64738 VOIP_PORT=64738
VOIP_ONION_PORT=8095 VOIP_ONION_PORT=8095
SSH_PORT=2222
USB_DRIVE=sdb USB_DRIVE=sdb
# get default USB from config file # get default USB from config file
CONFIGURATION_FILE=/root/${PROJECT_NAME}.cfg CONFIGURATION_FILE=/root/${PROJECT_NAME}.cfg
@ -57,6 +59,9 @@ if [ -f $CONFIGURATION_FILE ]; then
USB_DRIVE=$(echo ${USB_DRIVE} | awk -F '/' '{print $3}' | sed 's|1||g' | sed 's|2||g') USB_DRIVE=$(echo ${USB_DRIVE} | awk -F '/' '{print $3}' | sed 's|1||g' | sed 's|2||g')
fi fi
fi fi
if grep -q "SSH_PORT=" $CONFIGURATION_FILE; then
SSH_PORT=$(cat $CONFIGURATION_FILE | grep "SSH_PORT=" | awk -F '=' '{print $2}')
fi
fi fi
# Trove settings # Trove settings
@ -370,10 +375,27 @@ function show_users {
done done
} }
function show_trove_password {
if [ ! /home/trove ]; then
return
fi
if grep -q "MY_TROVE_PASSWORD" $CONFIGURATION_FILE; then
MY_TROVE_PASSWORD=$(grep "MY_TROVE_PASSWORD" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
echo 'Local Trove'
echo '==========='
echo ''
echo -n "URL: "
echo "$(cat ${COMPLETION_FILE} | grep 'ssh onion domain' | awk -F ':' '{print $2}')"
echo "SSH Port: $SSH_PORT"
echo "Password: $MY_TROVE_PASSWORD"
}
function show_about { function show_about {
clear clear
show_domains show_domains
show_users show_users
show_trove_password
any_key any_key
} }