forked from extremenetworks/ExtremeScripting
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSNTPConfig.xsf
More file actions
62 lines (52 loc) · 1.98 KB
/
Copy pathSNTPConfig.xsf
File metadata and controls
62 lines (52 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
enable cli scripting
disable clip
# @METADATASTART
#@DetailDescriptionStart
#############################################################################
#
# Script : SNTPConfig
# Revision : 1.0
# Last Updated : February 29, 2008
#
# Purpose: Configures a Simple Network Time Protocol (SNTP) for an
# ExtremeXOS(TM) switch to obtain time information from a remote
# Network Time Protocol (NTP) server. Shown in this example are:
#
# 1. SNTP client configuration
#
# 2. Timezone setup
#
# 3. SNTP client enablement
#
#############################################################################
#@DetailDescriptionEnd
#############################################################################
# Variable definitions
#############################################################################
set var clierrormode $READ("If this script encounters errors, do you wish to abort or ignore?")
set var ynsntp $READ("Set a Time Server? yes or no")
set var sntpserver $READ("SNTP server ipaddress e.g. 10.10.10.10")
set var tz $READ("Offset from GMT in minutes e.g. -360 for CST or -420 PST http://wwp.greenwichmeantime.com/ for more details")
set var dst $READ("Configure Daylight Savings Time? noautodst or autodst")
# @MetaDataEnd
#############################################################################
# Configure NTP client
#############################################################################
create log entry "Starting SNTP Configuration"
if (!$match($clierrormode,ignore)) then
configure cli mode scripting ignore-error
create log entry "CLI mode set for Ignore on Error"
else
configure cli mode scripting abort-on-error
create log entry "CLI mode set for Abort on Error"
endif
if (!$match($ynsntp,yes)) then
configure sntp-client primary $sntpserver
configure timezone $tz $dst
enable sntp-client
create log entry "SNTP Configured"
else
create log entry "SNTP NOT Configured"
endif
disable cli scripting
enable clip