Add hostname

This commit is contained in:
Antonio J. Delgado 2023-04-19 18:52:50 +03:00
parent ec868706bc
commit e5e55c9a48

View file

@ -181,7 +181,9 @@ if [[ "$o_longitude" == "West" ]]; then
fi fi
weather_url="http://api.wunderground.com/api/be78b9c2c0dbd00f/conditions/lang:ES/q/$g_latitude,$g_longitude.xml" weather_url="http://api.wunderground.com/api/be78b9c2c0dbd00f/conditions/lang:ES/q/$g_latitude,$g_longitude.xml"
temperature=$("${curl_cmd}" -s "$weather_url" | egrep -o "<temp_c>-?[0-9]*\.?[0-9]?</temp_c>" | sed "s/<temp_c>//g" - | sed "s|</temp_c>||g" -) temperature=$("${curl_cmd}" -s "$weather_url" | egrep -o "<temp_c>-?[0-9]*\.?[0-9]?</temp_c>" | sed "s/<temp_c>//g" - | sed "s|</temp_c>||g" -)
text="Image from $cur_date at $time\n$city $temperatureº C"
text="Host: ${hostname}\n${cur_date} at ${time}\n${city} ${temperature}º C"
convert_cmd=$(which convert) convert_cmd=$(which convert)
if [ ! -x "${convert_cmd}" ]; then if [ ! -x "${convert_cmd}" ]; then
if [ "$(which apt)" != "" ]; then if [ "$(which apt)" != "" ]; then