BBS水木清华站∶精华区

发信人: reden (鱼 ~ 看流星和她的故事), 信区: Linux 
标  题: Linux Remote-Boot mini-HOWTO(6/7) 
发信站: BBS 水木清华站 (Sun Oct 18 21:07:32 1998) WWW-POST 
 
Log "text" 
     Display the string on the log. No return/linefeed is implicitely added. 
Echo "text" 
     Display the string on the log and go to the next line. Equivalent to  
             Log "text\r\n". 
LogVars ("pattern") 
     Log (ie. display on the log) all variables matching the given pattern.  
The pattern can contain wildcards (? and *).  
     Example: LogVars "BOOTP-*"              list all BootP variables 
LogDir "path/pattern" 
     Log (ie. display on the log) all files from the given path that match  
the pattern. The pattern can contain wildcards (? and *).  
     Example: LogDir "/usr/g*p"              list files names like g...p 
LogTree "path" 
     Log the directory tree starting with the given path as root. 
LogFile "filename" 
     Log the content of the file. The file must be no more than 64 KB big. 
ShowLog 
     Make the log visible if it was hidden. Automatically performed when ESC  
is pressed with "$AutoShowLog" == "ON" and 
     when entering interactive mode. 
HideLog 
     Prevent log messages to appear on the screen. Default state when  
BpBatch, MrBatch and MrZip are started on a script 
     file. 
CaptureLog 
     Record all log output to a 64 KB buffer until EndCapture is issued. Wrap  
around buffer if the log output is more than 64 KB 
     big. This command can be used to create a text file with an arbitrary  
content. The EndCapture MUST occurs within the 
     same batch file. 
EndCapture ("filename") 
     End up the capture of the log. If a filename is given, store the  
captured text to a file. Otherwise, discard it. 
Beep 
     Make a sound. This command is equivalent to Echo "\007". 
 
Control commands 
 
This section lists commands that control the batch execution. Optional  
arguments are listed between parenthesis.  
 
Include "filename" 
     Load the given file and start up the parser on it. Go back to the  
current point when the include file processing is done. The 
     interpretation of characters above ASCII 127 within the include file  
depends on the value of $IsoLatin at the time the file is 
     included. 
 
OnExit command 
     Setup an exit-handler that will automatically be evaluated at the end of  
current batch file. 
 
Goto label 
     Move the execution cursor to the given label (ie. the line starting with  
label) 
 
Eval "command" 
     Perform all substitutions on the "command" and run the parser on it. 
 
If ... 
       If (not) <expr1> (==|!=|<|>|>=|<=|=>|=<|<>) <expr2> <command> 
       If (not) (ci) "str1" (==|!=|<|>|>=|<=|=>|=<|<>) "str2" <command> 
       If (not) (ci) "str1" Match-Expr "pattern" <command> 
       If (not) (ci) "str1" Match-Passwd "unix-passwd" <command> 
       If (not) (ci) "str1" in "wordlist" <command> 
       If (not) (ci) "str1" in-file "filename" <command> 
       If (not) exist "filename" <command> 
 
     These commands execute command; if the test succeeds. The 1st form  
compares two numerical expressions. The 2nd 
     form compares two strings, optionally case-insensitive. The 3rd form  
tests if "str1" matches the given pattern (wildcards 
     allowed). The 4th form tests if the clear password "str1" matches the  
Unix-crypted password. The 5th form tests if "str1" is 
     included in the word list. The 6th form tests if "str1" is included in  
the word file. The 7th form tests if the given file exists. 
 
Set ... 
       Set variable = "string-value" 
       Set variable = <expr> 
 
     Setup a value for the given variable. If the given value is a numerical  
expresison, it will be implicitely converted to a string. 
     A variable can be used anywhere by refering it as $variable or  
${variable}. If the resulting reference is to be interpreted as 
     a string, it should be enclosed between double quotes: "$variable" or  
"${variable}". 
 
Delay duration 
     Waits until the specified duration (expressed in seconds) expired. See  
also the paragraph on the format of durations. 
 
GetTime variable, GetDate variable 
     Get the CMOS time and store it into variablein the form HH:MM:SS. Get  
the CMOS date and store it into variablein the 
     form YY/MM/DD. This can be used to customize the behavior of your boot  
scripts depending on the time of day or on the 
     date. 
 
SetTime "HH:MM:SS", SetDate "YY/MM/DD" 
     Set the computer CMOS time or date to the given value. If you have a  
security gateway (our special TFTP server) running, 
     you can automatically adjust the CMOS time and date of the client  
computers at each boot by evaluating the following 
     command:  
 
             include "$Security-Gateway:gettime" 
 
     If you want to understand what this command does, just type:  
 
             logfile "$Security-Gateway:gettime" 
 
Poweroff 
     Turn off the computer. This command only works if the computer is  
Advanced Power Management (APM) compatible. 
 
Keyboard-related commands 
 
This section lists commands that let you monitor the keyboard input. Optional  
arguments are listed between parenthesis. See also 
under National Language Support.  
 
GetKey (variable) 
     Indefinitely wait until a key is pressed and store it in the variable. 
 
WaitForKey duration (command) 
     Wait until a key is pressed for no more than duration seconds. If no key  
has been pressed after the given time, evaluate 
     the command. Otherwise, leave the key in the keyboard buffer. See also  
the paragraph on the format of durations. 
 
Input (variable (max-length)) 
     Read a return-terminated string from the keyboard and store the result  
string in variable (without the terminating return). If 
     max-length is given, do not allow the user to enter more than this  
number of characters. 
 
     See also GetPasswd under Security-related commands. 
 
OnKey "c" command 
     Setup a key handler that will automatically evaluate the given command  
when the key "c" is pressed (except is explicitely 
     waited by a GetChar or an Input command). If the string "default" is  
used instead of a single character, the command 
     is executed if any other key is pressed. 
 
Text output commands 
 
This section lists commands used to perform regular text output. All these  
commands can be used in graphic mode also, with the 
same behaviour (except that text mode provides 80x25 characters while graphic  
mode provides 100x37, because graphic mode 
characters are of size 8x16). Optional arguments are listed between  
parenthesis. See also under National Language Support.  
 
Print "text"/expr 
 
     Print the specified string/expression at current cursor position and  
using current text attributes, then move the cursor. Add 
     "\r\n" to the end of the string to go to the next line. 
 
TextAttr fg-color bg-color 
     Setup the text attributes. One can also put a single numeric value  
representing both colors and defined as 
     16*bg-color+fg-color. 
 
     If you need more fantasy, you can use LoadFont. See under National  
Language Support. 
 
At line,col (command) 
     Move the cursor position to the specified position and evaluate the  
command if provided.  
 
     Example: At 10,20 Print "Gnats and rats !" 
 
Clear (color (pattern-char (top,left,bottom,right))) 
     Fill the given text area with the given pattern-char (either a string or  
the decimal ascii code). The area defaults to the full 
     screen, the pattern char defaults to the full block (ASCII dec 219) and  
the color defaults to black (clear screen). Move the 
     cursor to the upper left corner of the cleared area. 
 
BpMenu backward compatibility commands 
       .ATT (<attribute>) 
       .CLS (<attribute>) 
       .DEF <key> (<timeout_val>) 
       .KEY <key> <filename> 
       .POS ((<x>) <y>) 
       .PWD <key> <cpasswd> 
       .WLN (<text>) 
       .WRT <text> 
 
     See InCom's manual for more infos. We wrote some time ago a program  
program for editing menu files using this syntax, 
     but it is preferable to make your menus using the new explicit syntax.  
Note that the .PWD command is not implemented 
     because we do not now the password crypting algorithm used by InCom  
GmbH. 
 
Graphics output commands 
 
This section lists commands used to perform graphic-mode output. For the  
functions listed in this section, coordinates are given in 
pixels. You can also use all text output commands (see above) in graphic  
mode. Optional arguments are listed between 
parenthesis. 
 
Note that the graphic mode is automatically turned on whenever a graphic  
command is used, unless the variable VESA is set to 
"OFF".  
 
InitGraph ("mode") 
     Turn on VESA graphics. The origin is on the upper-left corner of the  
screen (0 0). VESA graphics may hang some 
     computers under Windows 95. Run MrBatch with the -v option to avoid such  
problems. 
 
     You can request a specific video mode if you use the parameter "mode"  
This parameter is optional: if you do not specify 
     any value, the video mode will be taken from the first field of the  
VESA-Modes variable. 
 
     Valid modes are :  
         640x480 => 640 by 480 pixels, 256 colors  
         800x600 => 800 by 600 pixels, 256 colors (default mode)  
         1024x768 => 1024 by 768 pixels, 256 colors  
         1280x1024 => 1280 by 1024 pixels, 256 colors  
 
     The VESA-Modes variable lists the video modes supported by your  
hardware. 
 
     Example: InitGraph "640x480" 
 
CloseGraph 
     Close VESA graphic mode and go back to text mode. 
 
DrawBar x-pos y-pos width height color 
     VESA graphics. Draw a filled bar of the given size and colors. 
 
DrawWindow x-pos y-pos width height (bg-color (bar-color)) ("title"  
(title-color)) 
     VESA graphics. Draw a window of the given size and colors. The  
background color defaults to LightGray and the title-bar 
     color defaults to Blue. If you include a title string and a color, this  
text will be displayed in the title bar. 
 
Drawtext x-pos y-pos "text" (fg-color) 
     VESA graphics. Draw the text string at the given position with a  
transparent background. The color defaults to text 
     foreground color. 
 
DrawGif "gif-filename" (x-pos y-pos (color-strategy)) 
     VESA graphics. Load the given GIF-87a file and draw it on the screen.  
The file can be interlaced, but must be in GIF-87a 
     (not GIF-89a). The image size should fit in the selected video mode. You  
cannot load a 1024x768 GIF file when you 
     selected a 640x480 mode. The GIF position defaults to the top left  
corner of the screen (0 0). 
 
     The color-strategy defines the allocation of colors in the palette when  
more than 256 colors are needed (for instance when 
     two 256 colors GIF files are displayed simultaneously):  
         Best-Colors use best possible colors for the most recent GIF  
         Spare-Colors try to avoid allocating colors, change existing colors  
 
         Share-Colors try to avoid allocating colors, use existing colors  
         Reuse-Colors allocate no new color, only use existing colors  
     The default strategy is Best-Colors. 
 
Security-related commands 
 
This section lists commands that help you authenticate a user. Optional  
arguments are listed between parenthesis. 
 
Some of these functions cooperate with a Security gateway, that you should  
first install. See the section on Special TFTP 
servers for more infos.  
 
GetPasswd (variable (max-length)) 
     Same as Input, but echo stars instead of the typed characters. 
 
Crypt "text" "salt" variable 
     Apply the Unix crypt function to the given 8-chars text and store the  
resulting crypted string into variable. The "salt" is 
     usually a two-character string that will be found as the first two  
characters of the crypted string. 
 
     Note that Unix crypt is a one-way function. It is not possible to decode  
the crypted string. One can only try to crypt another 
     string with the same salt and compre the resulting crypted string. 
 
DESCrypt "text" "key" variable 
     Crypt the given text using the given 8-chars key and store the result as  
an hexadecimal string in variable. 
 
DESDecrypt "hexcode" "key" variable 
     Decrypt the given hexadecimal string using the given 8-chars key and  
store the result in variable. 
 
MD5 "text" variable 
     Compute the MD5 checksum of the given text and store it as an  
hexadecimal string in variable. Can be used as an 
     alternative to the Unix crypt function to check for passwords bigger  
than 8 characters. 
 
CheckUser "user" "password" "domain" 
     Connect to the $Security-Gateway and check if the given user exist in  
the given radius domain and uses the specified 
     password. If the domain is "Unix", use the Unix user/password definition  
on the security gateway. For any other domain, 
     use the security gateway domain definition file to determine the real  
Radius or NT domain to check. 
 
     Set the value of $Security-Check to "PASSED" or "FAILED". The password  
do not transit in clear on the network. 
 
Disk-related commands 
 
This section lists commands for preparing the hard-disk. Optional arguments  
are listed between parenthesis.  
 
GetPartitions variable (disk) 
     Read the partition table(s) for the given disk and store it as a string  
into the given variable. The result string is a 
     space-separated list of Type:Size, where  
         Type is FAT16, EXT, BIGDOS, NTFS, FAT32, FAT32-LBA, BIGDOS-LBA,  
EXT-LBA, LINUX-SWAP, 
         LINUX-EXT2 or the decimal filesystem id for unknown types.  
         Size is the size of the partition in megabytes.  
 
SetPartitions "partitions" (disk) 
     Setup the partition table(s) to the content of the string. The format  
used is the same that for GetPartitions. This command 
     also reset all boot flags (hint: use SetBootPart). 
 
     If you want to use extended partitions, remember that they begin after  
each four partitions. You can use EMPTY to leave 
     a free entry in the partition table. For instance, if you want to setup  
a primary dos partition of 100 MB and a logical dos 
     partition of 400 MB, you must execute  
 
             SetPartitions "BIGDOS:100 EXT:400 EMPTY EMPTY BIGDOS:400" 
 
GetBootPart variable (disk) 
     Get the partition number with the boot flag turned on (DOS says: the  
activated primary partition) and store it to the 
     variable. The first partition is numbered 1. If no partitions has the  
boot flag turned on, answers zero. 
 
SetBootPart partition (disk) 
     Set the boot flag to the given partition. The boot flag let the master  
boot record (MBR) choose which partition to boot on. 
     The first partition is numbered 1. 
 
Blank partition (disk) 
     Fill the given partitions with zeroes. Can take quite a lot of time for  
big partitions. Do not format the partition for any 
     operating system. See also Clean. 
 
 
-- 
    白马带著她一步步的回到中原。白马已经老了,只能慢慢的走, 
但终是能回到中原的。江南有杨柳、桃花,有燕子、金鱼…… 
汉人中有的是英俊勇武的少年,倜傥潇洒的少年……但这个美 
丽的姑娘就像古高昌国人那样固执: 
 
    「那都是很好很好的,可是我偏不喜欢。」  
 
※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: 202.99.18.67]  

BBS水木清华站∶精华区