 #Ctrl+a d - download and do a clean install of a given NSM version,
 Ctrl+a i - can be entered during the nsm installation will answer all the questions (clean install Gui+Dev if installing from scratch or just refresh otherwise),
 Ctrl+a x - stop/status/start/restart/version on all three services,
-Ctrl+a t - prints current timestamp in the format %Y%m%d%H%M%S sutaible for naming backups/copies of files,
+Ctrl+a t - prints current timestamp in the format %Y%m%d%H%M%S suitable for naming backups/copies of files,
 #Ctrl+a f - trigger an action based on a pattern match, if pattern is found, a script on the remote machine will be run /root/data.sh
 "
       send "\r"

 2 - truncate the schema,
 3 - correct the customer db (super password, IPs),
 4 - prepare a command that will uninstall all NSM packages and remove all the NSM data from the server, the command is printed without \\r at the end,

 input: "
      stty cooked echo 

#!/usr/bin/expect -f

# ver: 20120215
#
# ChangeLog:
# 20120215:
# - added all the /usr/netscreen/*/utils to the PATH,
# - added menu item to export and import the db,
# - added possible env variable NSM_LOGIN_ARCH to specify 
#   where to save the session logs,
# - various small fixes,
# 20120213:
# - added env support for easier usage of dbxml,


#### TO DO:
#
# - auto installation of NSM possible from inside this client,
# - auto log monitoring and doing an action once a pattern is found,


if {[info exists env(NSM_LOGIN_ARCH)]} {
  set logdir "$env(NSM_LOGIN_ARCH)"
} else {
  set logdir "$env(HOME)/store/work/_archives_worklogs/"
}

set send_slow {10 .01}
set timeout 60
