diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-12-26 14:03:40 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-12-26 14:03:40 +0100 |
commit | 8cb881bd060d595e679446bec7169e09d03383de (patch) | |
tree | b4184b1bc97461aa224bb3c2220fc1e8837fd98f /templates | |
parent | 0b8818dec45567d794b1d648e37639f28df8e64a (diff) | |
download | vyatta-cfg-system-8cb881bd060d595e679446bec7169e09d03383de.tar.gz vyatta-cfg-system-8cb881bd060d595e679446bec7169e09d03383de.zip |
time-zone: T1906: migrate to XML/Python
Diffstat (limited to 'templates')
-rw-r--r-- | templates/system/time-zone/node.def | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/templates/system/time-zone/node.def b/templates/system/time-zone/node.def deleted file mode 100644 index def367f4..00000000 --- a/templates/system/time-zone/node.def +++ /dev/null @@ -1,61 +0,0 @@ -priority: 100 -type: txt -help: Local time zone -default: "UTC" -update: LTF="/usr/share/zoneinfo" - case "$VAR(@)" in - [Ll][Oo][Ss]*) LTF="$LTF/US/Pacific" ;; - [Dd][Ee][Nn]*) LTF="$LTF/US/Mountain" ;; - [Hh][Oo][Nn][Oo]*) LTF="$LTF/US/Hawaii" ;; - [Nn][Ee][Ww]*) LTF="$LTF/US/Eastern" ;; - [Cc][Hh][Ii][Cc]*) LTF="$LTF/US/Central" ;; - [Aa][Nn][Cc]*) LTF="$LTF/US/Alaska" ;; - [Pp][Hh][Oo]*) LTF="$LTF/US/Arizona" ;; - GMT*) LTF="$LTF/Etc/$VAR(@)" ;; - *) LTF="$LTF/$VAR(@)" ;; - esac - if [ -f "$LTF" ]; then - sudo ln -fs $LTF /etc/localtime - sudo sh -c "echo $VAR(@) > /etc/timezone" - else - echo "Invalid timezone" - exit 1 - fi -delete: sudo ln -fs /usr/share/zoneinfo/UTC /etc/localtime - sudo sh -c "echo UTC > /etc/timezone" -allowed: shopt -s nullglob - word=${COMP_WORDS[$COMP_CWORD]} - if [[ $word == */* ]]; then - marr=($(ls -d /usr/share/zoneinfo/$word*)) - else - marr=($(find /usr/share/zoneinfo/ -maxdepth 1 -type d \ - -name "$word*")) - fi - if (( ${#marr[@]} == 1 )); then - word=${marr[0]#/usr/share/zoneinfo/} - fi - if [ -n "$word" ] && [[ $word != */ ]]; then - marr=($(ls -d /usr/share/zoneinfo/$word*)) - if (( ${#marr[@]} == 1 )) \ - && [ -d "/usr/share/zoneinfo/$word" ]; then - word=$word/ - elif [[ $word == */* ]]; then - word=${word%/*}/ - fi - fi - for z in $(ls -d /usr/share/zoneinfo/$word* \ - 2>/dev/null | egrep '^/usr/share/zoneinfo/[A-Z]'); do - zz=${z#/usr/share/zoneinfo/} - if [ -d $z ] || [[ $zz == */* ]]; then - echo \"$zz\" - fi - done -end: if [ "$COMMIT_ACTION" == "SET" -o "$COMMIT_ACTION" == "DELETE" ]; then - sudo /etc/init.d/rsyslog restart - fi -comp_help:Enter the local timezone by specifying "Region/City" - Use auto-completion to see available regions and cities. - Start with one of these regions: - Africa America Antarctica Arctic Asia Atlantic - Australia Brazil Canada Chile Europe Indian - Mexico Mideast Pacific US |