D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
lib
/
scsi
/
Filename :
save-file
back
Copy
#!/usr/bin/wish -f set sdevice $argv frame .win frame .win.h label .win.h.l -bitmap questhead -background pink message .win.h.m -aspect 400 -background pink -justify center -text \ {Save the selected values from the target into a disk file. \ The file is executable. Just execute it with /bin/sh to make these \ settings the current settings. Then you can decide to store them in the NVRAM \ of the target device with scsiinfo or scsi-config.} pack .win.h.l .win.h.m -side left -padx 5 pack .win.h -side top -pady 20 -padx 20 frame .win.fname label .win.fname.label -text "Filename:" text .win.fname.text -background white -height 1 -width 40 -relief sunken -borderwidth 2 pack .win.fname.label .win.fname.text -side left -padx 1 pack .win.fname -side top -padx 20 -pady 10 set base [exec basename $sdevice] .win.fname.text delete 1.0 end .win.fname.text insert end "/var/run/scsi-config.$base" frame .win.f radiobutton .win.cur -text "Current values" -width 20 -variable flag -value "-LXR" -anchor w radiobutton .win.sav -text "Saved values" -width 20 -variable flag -value "-LXRS" -anchor w radiobutton .win.man -text "Factory defaults" -width 20 -variable flag -value "-LXRM" -anchor w pack .win.cur .win.sav .win.man -padx 3 .win.cur select button .win.f.quit -width 10 -text "Quit" -command exit \ -activebackground red -activeforeground white button .win.f.continue -width 10 -text "Save" \ -activebackground green \ -command {global fname; set fname [.win.fname.text get 1.0 "end -1 chars"]; destroy .win} pack .win.f.continue .win.f.quit -side left -padx 30 -ipadx 2 -ipady 2 pack .win.f -pady 10 pack .win tkwait window .win # This should do it. Do not come and complain to me if this # does not work exec scsiinfo $flag $sdevice > $fname exec chmod 700 $fname exit