curl silent mode

This commit is contained in:
Bob Mottram 2018-04-12 15:24:24 +01:00
parent 2a53814aed
commit 797b2a3a35
1 changed files with 2 additions and 2 deletions

View File

@ -87,7 +87,7 @@ function install_static_network {
} }
function get_external_ipv4_address { function get_external_ipv4_address {
curl ipinfo.io/ip curl -s ipinfo.io/ip
} }
function get_ipv4_address { function get_ipv4_address {
@ -104,7 +104,7 @@ function update_external_ip {
ip_update_script=/usr/bin/externalipupdate ip_update_script=/usr/bin/externalipupdate
{ echo '#!/bin/bash'; { echo '#!/bin/bash';
echo "existing_ip=\$(cat $CONFIGURATION_FILE | grep \"EXTERNAL_IPV4_ADDRESS=\" | head -n 1 | awk -F '=' '{print \$2}')'"; echo "existing_ip=\$(cat $CONFIGURATION_FILE | grep \"EXTERNAL_IPV4_ADDRESS=\" | head -n 1 | awk -F '=' '{print \$2}')'";
echo "curr_ip=\$(curl ipinfo.io/ip)"; echo "curr_ip=\$(curl -s ipinfo.io/ip)";
echo "if [[ \"\$curr_ip\" != \"\$existing_ip\" ]]; then"; echo "if [[ \"\$curr_ip\" != \"\$existing_ip\" ]]; then";
echo " sed -i \"s|EXTERNAL_IPV4_ADDRESS=.*|EXTERNAL_IPV4_ADDRESS=\${curr_ip}|g\" $CONFIGURATION_FILE"; echo " sed -i \"s|EXTERNAL_IPV4_ADDRESS=.*|EXTERNAL_IPV4_ADDRESS=\${curr_ip}|g\" $CONFIGURATION_FILE";
echo " echo \"\$(date)\" >> ~/${PROJECT_NAME}-external-ip-changes.txt"; echo " echo \"\$(date)\" >> ~/${PROJECT_NAME}-external-ip-changes.txt";