Handle quotes

This commit is contained in:
Bob Mottram 2015-12-07 10:58:30 +00:00
parent a6dee9f998
commit e15c01b7b9
1 changed files with 2 additions and 2 deletions

View File

@ -709,7 +709,7 @@ function change_system_name {
}
function set_tls_time_source {
TLS_DATE_SOURCE=$(cat $UPDATE_DATE_SCRIPT | grep 'TIMESOURCE=' | awk -F '=' '{print $2}')
TLS_DATE_SOURCE=$(cat /usr/bin/updatedate | grep "TIMESOURCE='" | awk -F '=' '{print $2}' | awk -F "'" '{print $2}')
data=$(tempfile 2>/dev/null)
trap "rm -f $data" 0 1 2 5 15
dialog --title $"Set the TLS date/time source" \
@ -720,7 +720,7 @@ function set_tls_time_source {
0) NEW_TLS_DATE_SOURCE=$(<$data)
if [[ $NEW_TLS_DATE_SOURCE == *"."* && $NEW_TLS_DATE_SOURCE != *'/'* ]]; then
if [[ $NEW_TLS_DATE_SOURCE != "http"* ]]; then
sed -i "s|TIMESOURCE=.*|TIMESOURCE=${NEW_TLS_DATE_SOURCE}|g" $UPDATE_DATE_SCRIPT
sed -i "s|TIMESOURCE='.*|TIMESOURCE='${NEW_TLS_DATE_SOURCE}'|g" $UPDATE_DATE_SCRIPT
else
dialog --title $"Invalid domain name" \
--msgbox $"Don't include the 'https'" 6 70