diff options
author | Stig Thormodsrud <stig@vyatta.com> | 2007-11-27 13:46:15 -0800 |
---|---|---|
committer | Stig Thormodsrud <stig@vyatta.com> | 2007-11-27 13:46:15 -0800 |
commit | 7e0cd1281925ab017eeb08877be528d46ae23257 (patch) | |
tree | 689fd4dc80d68940d72a35ddf3a50da1df7404f4 /templates/system/time-zone | |
parent | 5d09a07e0fa9567559f2929f026cdf970a8015df (diff) | |
download | vyatta-cfg-system-7e0cd1281925ab017eeb08877be528d46ae23257.tar.gz vyatta-cfg-system-7e0cd1281925ab017eeb08877be528d46ae23257.zip |
Fix "set system time-zone" doesn't verify valid time-zone.
Diffstat (limited to 'templates/system/time-zone')
-rw-r--r-- | templates/system/time-zone/node.def | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/templates/system/time-zone/node.def b/templates/system/time-zone/node.def index 72ca791e..60e87e12 100644 --- a/templates/system/time-zone/node.def +++ b/templates/system/time-zone/node.def @@ -12,7 +12,12 @@ case \"$(@)\" in \ [Pp][Hh][Oo]*) LTF=\"\\\$LTF/US/Arizona\" ;; \ *) LTF=\"\\\$LTF/Etc/$(@)\" ;; \ esac && \ -sudo ln -fs \\\$LTF /etc/localtime" +if [ -e \"\\\$LTF\" ]; then \ + sudo ln -fs \\\$LTF /etc/localtime; \ +else \ + echo \"Invalid timezone\"; \ + exit 1; \ +fi" delete: "sudo ln -fs /usr/share/zoneinfo/GMT /etc/localtime" #allowed: local -a list=( "Los Angeles" "New York" "Denver" "Chicago" \ # "Anchorage" "Honolulu" "Phoenix" "GMT" ) |