Login Script Commands for Login Script Execution

Login Script Commands for Login Script Execution

The following script commands are available for login script execution:

  • BREAK

  • FIRE or FIRE PHASERS

  • IF...THEN

  • INCLUDE

  • NO_DEFAULT

  • PAUSE

  • PROFILE

Each of these commands is covered in detail in the following sections.

BREAK

BREAK ON allows the users to terminate login script execution. The default is BREAK OFF . If BREAK ON is included in a login script, the users can press Ctrl+C or Ctrl+Break to abort the normal execution of the login script.

FIRE or FIRE PHASERS

FIRE or FIRE PHASERS emits a phaser sound by playing the phasers.wav sound file. Use FIRE or FIRE PHASERS with the IF...THEN command to make the sound execute a different number of times depending on the circumstances of the login.

 
 FIRE  n soundfile  

Replace n with the number of times you want this sound to occur.

Replace soundfile with the name of the sound file you want to play when this command is executed. You can use any .WAV or platform-compatible sound file. For example

 
 FIRE 3 RIFLE.WAV 

To use a variable as the number of times to fire, use % before the variable identifier. This allows you to vary the fire number based on some other conditional event.

 
 FIRE %variable 

For more information about using variables, see the section called "Identifier Variables " later in this appendix.

IF...THEN

IF...THEN performs an action only under certain conditions. For example:

 
 IF MEMBER OF "SALES"  THEN 

In this statement, some action is performed if the user who logged in belongs to the Group object named SALES . You might also use IF...THEN to specify a specify time or date. For example:

 
 IF DAY_OF_WEEK=" MONDAY" 

In this statement, the equal sign (=) indicates the relationship between the variable ( DAY_OF_WEEK ) and its value ( MONDAY ). Note that the value ( MONDAY ) is placed inside quotation marks. The values of conditional statements must be enclosed in quotation marks. Furthermore, when using IF...THEN statements, you can use AND or OR to include two or more conditionals in an IF...THEN statement.

Finally, values of conditional statements are compared with the assumption that the values are characters , not numeric values. The value of 21, therefore, is considered greater than the value of 100 when comparing these two characters. To ensure that the system properly calculates numeric values instead of character values, use the VALUE modifier in the IF...THEN statement.

The ELSE statement is optional. When used, the IF , ELSE , and END commands must be on separate lines. THEN does not need to be on a separate line. If you include a WRITE command as part of the IF...THEN command, the WRITE command must be on a separate line.

IF...THEN statements can be nested (up to 10 levels). If your IF...THEN statement consists of only one line, you do not need to include END even if that line wraps. If your IF...THEN statement must be on more than one line (for example, if you used ELSE or WRITE , which must be on separate lines), you must include END .

Six Boolean operators can be used between the elements of an IF...THEN statement. They are

  • = Equals

  • < > Does not equal

  • > Is greater than

  • >= Is greater than or equal to

  • < Is less than

  • <= Is less than or equal to

When using IF...THEN statements, use the following syntax:

 
 IF  conditional  [ANDOR [  conditional  ]] THEN  commands  [ELSE  command  ] [END] 

Replace conditional with identifier variables. Replace commands with any login script commands that you want to be executed if the specified condition is true. For example, if you place the following command in a login script, the message "Status report is due today" appears when the user logs in on Friday and "Have a nice day!" appears on other days:

 
 IF DAY_OF_WEEK=" FRIDAY"  THEN    WRITE "Status report is due today."  ELSE    WRITE "Have a nice day!"  END 

You can also nest IF...THEN statements. Notice that if there are multiple IF statements, each must have its own END statement:

 
 IF DAY_OF_WEEK=" FRIDAY"  THEN    WRITE "Status report is due today."     IF MEMBER OF OPERATIONS THEN       WRITE "Your report is due immediately!"     END END 

Conditionals can be joined with commas, the word AND , or the word OR to form compound conditionals. The first line of the following IF...THEN statement is a compound conditional that means "If it is the evening of the first day of the month":

 
 IF GREETING_TIME=" EVENING"  AND DAY=" 01"  THEN    WRITE "The system will be backed up tonight."  END 

An IF...THEN statement can include several commands that must be executed if the conditional is true.

The following example shows two commands that are executed on Tuesdays: a WRITE command that displays a message about a staff meeting, and an INCLUDE command that tells the login script to process any commands or messages contained in the file SYS:PUBLIC\UPDATE.TXT .

 
 IF DAY_OF_WEEK=" TUESDAY"  THEN    WRITE "Staff meeting today at 10 a.m."     INCLUDE SYS:PUBLIC\UPDATE.TXT END 

INCLUDE

INCLUDE executes independent files or another object's login script as a part of the login script currently being processed . These can be text files that contain valid login script commands (any of the commands explained in this section) or login scripts that belong to a different object you have rights to. Text files that contain login script commands and other objects' login scripts can be used as subscripts. Subscripts do not have to have any particular filenames or extensions.

The INCLUDE command executes the login script commands contained in the subscript. It does not display the text of the subscripts. If the subscript is a text file, users must have at least File Scan and Read rights to the directory containing the subscript. If you are using another object's login script as a subscript, users must have the Browse right to the object whose script you are including and the Read right to the object's Login Script property.

 
 INCLUDE [  path  ]  filename  

or

 
 INCLUDE  object_name  

Replace path with either a drive letter or a full directory path beginning with the NetWare volume name. To use a text file as a subscript, replace filename with the complete name (including the extension) of the text file. See the example in the IF...THEN section.

Alternatively, you can replace object_name with the name of the object whose login script you want to use.

NO_DEFAULT

NO_DEFAULT in a container or profile login script indicates that do not want to create any user login scripts, and you do not want the default login script to run. To use NO_DEFAULT , add this command to either the container or the profile login script. If you have created a user login script for someone, that login script executes whether or not the NO_DEFAULT command is in the container or profile login script.

PAUSE

PAUSE creates a pause in the execution of the login script. You can add PAUSE to the login script following a message so that the user has time to read the message before it scrolls off the screen. If you include PAUSE , the message "Strike any key when ready..." appears on the workstation screen. NetWare login then waits for a key to be pressed before it executes the rest of the login script.

PROFILE

Using PROFILE in a container script overrides a user's assigned or command line-specified profile script. This is useful when defining a group profile. Use the following syntax:

 
 PROFILE  profile_object_name  

Replace profile object name with the name of the profile that you want to override the default profile script that is assigned to a given user.



Novell NetWare 6. 5 Administrator's Handbook
Novell NetWare 6.5 Administrators Handbook
ISBN: 0789729849
EAN: 2147483647
Year: 2002
Pages: 172

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net