Similar process, written in TCL to determine if a REBOOT is required.
Called from EXBSETUP in a CLIENT.SETTINGS instance.
############################################################################
# logmsg: Log messages to file routine
############################################################################
proc logmsg { msg } {
global logfile
set fd [ open $logfile a ]
puts $fd "[clock format [ clock seconds ] -format {%d%m%Y %X}] :: $msg"
close $fd
}
############################################################################
# MAIN SECTION
############################################################################
nvd::init
global logfile
set logfile_start "${::NVDLOG}pinswitch"
set logfile "${logfile_start}.log"
set logfile_backup "${logfile_start}.bak"
if { [ file exist $logfile ] } { catch { file rename -force $logfile $logfile_backup } }
#CHECK 1 - Is Agent doing an immediate reboot?
logmsg "CHECKING for a flagged reboot via RADSETUP.EDM"
if { [ catch { set radsetup [nvdobj #auto -file ${::NVDLIB}RADSETUP.EDM] } err ] } {
logmsg "----Error opening RADSETUP.EDM"
exit
}
set BOOTIMMD [string trim [string toupper [$radsetup get 0 BOOTIMMD] ]]
$radsetup close
logmsg "----BOOTIMMD : $BOOTIMMD"
if { $BOOTIMMD == "Y" } {
logmsg "* Agent requires an immediate reboot, disabling BitLocker PIN *"
#INSERT PIN SWITCH CALL HERE#
exit
} else {
logmsg "* Agent does not require an immediate reboot *"
}