Sponsored Content
Full Discussion: why wont this script run?
Top Forums Shell Programming and Scripting why wont this script run? Post 302086732 by BG_JrAdmin on Sunday 27th of August 2006 03:53:36 AM
Old 08-27-2006
why wont this script run?

i have this script i wrote, it chokes when running the add install client commandit keeps telling me the add_install_client command is incorrect.
When I put the print statement in front of the command so it will echo it, the command looks right on the screen. Yes im am an ametuer, im trying to learn perl, any help would be appreciated.. thanks!


#usr/bin/perl
#
# USAGE:
# jumpit arg1 arg2 arg3 arg4
#
# arg1 = Number O/S (8, 9 or 10)
# arg2 = Hostname
# arg3 = IP Address
# arg4 = MAC Address
#
echo "$3 $2" >> /etc/hosts
echo "$4 $2" >> /etc/ethers
cd /export/config/Solaris$1/
echo "hostname $2 - $2 -" >> /export/config/Solaris$1/rules
/export/config/Solaris$1/check
#
cd /export/install/Solaris"$1"/Solaris_"$1"/Tools/
/export/install/Solaris"$1"/Solaris_"$1"/Tools/add_install_client -c motjmpst:/e
xport/config/Solaris"$1" -p motjmpst:/export/config/Solaris"$1 $2" sun4u


Here is what i get when i change the command in the script to be printed on the screen:

# ./jumpit 9 brian 192.168.15.11 8:0:20:c0:8f:a1
Validating rules...
Validating profile ultra5bg...
Validating profile brian...
The custom JumpStart configuration is ok.

/export/install/Solaris9/Solaris_9/Tools/add_install_client -c motjmpst:/export/config/Solaris9 -p motjmpst:/export/config/Solaris9 brian sun4u

This is the correct command syntax it works if i type it into the command line, so im not sure why its not running from within the script.

Last edited by BG_JrAdmin; 08-27-2006 at 05:00 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script wont run from cron job

I have written a simple bash script that will run a wget command to recursively ftp an entire directories and it's contents. #!/bin/bash wget -r -N ftp://user:pass@server//VOL1/dir If I run from the regular command line it works fine. root@BUSRV: /media/backup1$ ./gwbu When I put it in... (1 Reply)
Discussion started by: mgmcelwee
1 Replies

2. HP-UX

emacs wont run

hi i keep getting this error message when i try and run emacs: /usr/lib/dld.sl: Unresolved symbol: pthread_mutex_init (code) from ./emacs Abort any ideas? thanks ed. (4 Replies)
Discussion started by: deusprogrammer
4 Replies

3. Shell Programming and Scripting

My Wireless Script Wont Work.....anyone??

ive been trying to write a simple (at least i thought it was) script to launch my wireless usb under ubuntu with kde. im using nano. when i run it from a terminal it works fine, but it just wont run from the script. there is a caveat, but first heres the script. ... (7 Replies)
Discussion started by: braze
7 Replies

4. Shell Programming and Scripting

script wont run

$ ls -l total 44 drwx------ 2 ivanachu users 512 Dec 6 19:15 VILEARN -rw------- 1 ivanachu users 74 Dec 5 18:42 cond -rwx------ 1 ivanachu users 97 Dec 5 21:30 cond2 -rwxrwxrwx 1 ivanachu users 4979 Feb 10 22:42 createHAqmgr.ksh -rw------- 1 ivanachu users 28 Dec 4... (10 Replies)
Discussion started by: ivanachukapawn
10 Replies

5. Shell Programming and Scripting

2 commands in script wont work together

For some reason when I run these separately they work but when they are in a script file the second wont: printf "%s\n" "$RANDOM"."$RANDOM" "$RANDOM"."$RANDOM" "$RANDOM"."$RANDOM" "$RANDOM"."$RANDOM" | tee $HOME/bpl/random RANDOM1=$( <$HOME/bpl/random ) Anyone know why? (8 Replies)
Discussion started by: pkohn11
8 Replies

6. Programming

IO Error - xmal feed wont run

Keep getting IO Error and •nonnumeric port: '' (InvalidURL; misconfigured server?) This in relation to RSS feeds. We have done a load of work to try to get RSS feeds working. Now they work. But they wont validate. http://www.ukcitymedia.co.uk/news/rss.php?feed=New_News ... (0 Replies)
Discussion started by: alankeys
0 Replies

7. UNIX for Dummies Questions & Answers

Tcl script wont run in bash shell

Hello I'm having a problem running a TCL script in my new OpenSolaris OS. When I go to the directory containing my script called 'Install' (using the gnome terminal), it doesn't seem to be able to find it even though it lists it i.e. if I type "Inst" and hit tab to complete the word, it... (11 Replies)
Discussion started by: sbsbg
11 Replies

8. Shell Programming and Scripting

Bash script wont exit?

Solved Stupidly I didn't put brackets around the , thanks for all the help guys if ps ax | grep Cluster__check.bash | grep -v grep > /dev/null -- fails (if ps ax | grep Cluster__check.bash | grep -v grep > /dev/null) --works (3 Replies)
Discussion started by: danmc
3 Replies

9. Shell Programming and Scripting

Shell script wont execute

Im using a script that writes a random line to a text file then executes another shell script. My problem is that the lottery shell script will not execute. Im not receiving an errors when running the shell script, and it copies a random line of text to mtest.txt fine. #!/bin/bash nscripts=2... (3 Replies)
Discussion started by: kylecn
3 Replies

10. Linux

Apt-get update wont run and gives 503 service unavailable error

Hi, I am running on Ubuntu 12 (precise) 64 bit and came to know that i cannot install any packages using apt-get and aptitude. Linux test01 3.5.0-23-generic #35~precise1-Ubuntu SMP Fri Jan 25 17:13:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux But the same /etc/apt/sources.list file is... (20 Replies)
Discussion started by: prash358
20 Replies
install_scripts(1M)					  System Administration Commands				       install_scripts(1M)

NAME
install_scripts, add_install_client, add_to_install_server, rm_install_client, setup_install_server, check - scripts used to install the Solaris software SYNOPSIS
media-mnt-pt/Solaris_XX/Tools/add_install_client [-i IP_address] [-e Ethernet_address] [ -s server_name : path] [ -c server_name : path] [ -n [server ] : name_service [ ( netmask]] [ -p server_name : path] [-t install_boot_image_path] host_name platform_group media-mnt-pt/Solaris_XX/Tools/add_install_client -d [-s server_name:path] [-c server_name:path] [-p server_name:path] [-t install_boot_image_path] [-f boot_file_name] platform_name platform_group media-mnt-pt/Solaris_XX/Tools/add_install_client -d [-s server_name:path] [-c server_name:path] [-p server_name:path] [-t install_boot_image_path] [-f boot_file_name] -e Ethernet_address [-b property=value] platform_group media-mnt-pt/Solaris_XX/Tools/add_to_install_server [-s] [-p product_image_path] install_server_path media-mnt-pt/Solaris_XX/Tools/jumpstart_sample/check [-p install_dir_path] [-r rulesfile] media-mnt-pt/Solaris_XX/Tools/rm_install_client host_name media-mnt-pt/Solaris_XX/Tools/rm_install_client platform_name media-mnt-pt/Solaris_XX/Tools/rm_install_client -e Ethernet_address media-mnt-pt/Solaris_XX/Tools/rm_install_client -f boot_file_name media-mnt-pt/Solaris_XX/Tools/setup_install_server [-b] [-t install_boot_image_path] [-w wanboot_image_path] install_dir_path DESCRIPTION
These commands are located on slice 0 of the Solaris Software and Solaris Installer CDs or DVDs. (The terms "CD" and "DVD" are hereafter referred to as "installation media".) If the Solaris installation media has been copied to a local disk, media_mnt_pt is the path to the copied Solaris installation media. They can be used for a variety of installation tasks. The XX in Solaris_XX is the version number of the Solaris release being used. There are three versions of the add_install_client command. See SYNOPSIS. Use the following version of the add_install_client command to add clients for network installation (these commands update the boot- params(4) file). The add_install_client command must be run from the install server's Solaris installation image (a mounted Solaris instal- lation media or a Solaris installation media copied to disk) or the boot server's boot directory (if a boot server is required). The Solaris installation image or the boot directory must be the same Solaris release that you want installed on the client. media-mnt-pt/Solaris_XX/Tools/add_install_client [-i IP_address] [-e Ethernet_address] [ -s server_name : path] [ -c server_name : path] [ -n [server ] : name_service [ ( netmask]] [ -p server_name : path] [-t install_boot_image_path] host_name platform_group Use the following version of the add_install_client command to add support for instances of a platform within a platform group to the install server. This group is booted and configured using DHCP. The script performs the necessary configuration steps on the server, and prints the data that the user needs to add to the DHCP server for the group. media-mnt-pt/Solaris_XX/Tools/add_install_client -d [-s server:path] [-c server:path] [-p server:path] [-t install boot image path] [-t install_boot_image_path] [-f boot file name] platform_name platform_group Use the following version of the add_install_client command to add a single client to the install server. This client is booted and config- ured using DHCP. The script performs the necessary configuration steps on the server, and prints the data that the user needs to add to the DHCP server for the client. The -f flag used above needs to be added to the existing usage as well. -f allows the user to specify a boot file name to be used for a given client. media-mnt-pt/Solaris_XX/Tools/add_install_client -d [-s server_name:path] [-c server_name:path] [-p server_name:path] [-t install_boot_image_path] [-f boot_file_name] -e Ethernet_address platform_group [-b property=value] platform_group Always use the -d option when registering x86 Architecture Pre-boot eXecution Environment (PXE) clients. These clients use DHCP for their configuration. Use add_to_install_server to merge other Solaris installation media with an existing image on a Net Install Server. Each installation media that can be merged (each OS CD or DVD, and the Language CD or DVD) has its own add_to_install_server script. Do not use add_to_install_server scripts with installation media other than the ones with which they were delivered. Use check to validate the rules in a rules file (this is only necessary if a custom JumpStart installation is being set up). Use rm_install_client to remove clients for network installation (these commands update the bootparams(4) file). Use setup_install_server to copy the Solaris installation media to a disk (to set up an install server), to build a WANboot miniroot image (to set up a WANboot install server), or to copy just the boot software of the Solaris installation media to a disk (to set up a boot server). An install server is required to install clients over the network. A boot server is also required for network installations if the install server and clients to be installed are on different subnets (the boot server must be located on the client's subnet). OPTIONS
The add_install_client supports the following options: -b property=value Set a property value in the client specific bootenv.rc file located on the boot server's TFTP directory, /tftpboot by default. Use this option to set boot properties that are specific to this client. You can use the bootpath property to automate the selection of the boot device instead of manually using the Device Configuration Assistant. You can use the boot-args property to automatically select a jump- start installation. See eeprom(1M). You can only use this option to the x86 client. You should only use this option in conjunction with the -d and -e options. -c server_name:path This option is required only to specify a JumpStart directory for a custom JumpStart installation. server_name is the host name of the server with a JumpStart directory. path is the absolute path to the JumpStart directory. -d Specify as a DHCP client. -e Ethernet_address Specify the Ethernet address of the system to be installed. -f Specify the boot_file_name of the client to be installed. -i IP_address Specify the IP address of the client to be installed. -n [server]:name_service[(netmask)] This option specifies which name service should be used during system configuration. This sets the ns keyword in the bootparams(4) file. name_service Valid entries are nis, nisplus, and none. netmask A series of four numbers separated by periods, specifying which portion of an IP address is the network part, and which is the host part. server The name of the server or IP address of the specified name service. If the server specified is on a different subnet, then the net- mask may be needed to enable the client to contact the server. -p server_name:path This option is the location of the user-defined sysidcfg file for pre-configuring system or network information. server_name is either a valid host name or IP address. path is the absolute path to the Jumpstart directory. -s server_name:path This option is required only when using add_install_client from a boot server. Specify the name of the server and the absolute path of the Solaris installation image that is used for this installation. path is either the path to a mounted Solaris installation media or a path to a directory with a copy of the Solaris installation media. -t Allows you to specify an alternate miniroot The add_to_install_server command supports the following options: -p Specifies the location of the installation media (containing the supplemental products) to be copied. -s Allows users to select from a list only the products needing installation. The check command supports the following options: -p install_dir_path Validates the rules file by using the check script from a specified Solaris installation image, instead of the check script from the system you are using. install_dir_path is the path to a Solaris installation image on a local disk or a mounted Solaris installation media. Use this option to run the most recent version of check if your system is running a previous version of Solaris. -r rulesfile Specifies a rules file other than the one named rules. Using this option, the validity of a rule can be tested before integrating it into the rules file. check reports whether or not the rule is valid, but it does not create the rules.ok file necessary for a custom JumpStart installation. The rm_install_client command supports the following options: -e Ethernet_address Specify the Ethernet address of the system to be removed. -f Specify the boot_file_name of the client to be removed. The setup_install_server command supports the following options: -b This option sets up the server only as a boot server. -t This option allows an alternate miniroot to be specified. -w This option builds a WANboot miniroot image. OPERANDS
The add_install_client command supports the following operands: host_name This is the name of the client to be installed. platform_group Vendor-defined grouping of hardware platforms for the purpose of distributing specific software. Examples of valid platform groups are: +-----------------------------+-----------------------------+ | System | Platform Group | |x86 |i86pc | |Sun Fire 4800 |sun4u | +-----------------------------+-----------------------------+ Use the uname(1) command (with the -m option) to determine a system's platform group. platform_name Use the uname(1) command (with the -i option) to determine a system's platform name. The following example shows the use of the uname command to determine the system platform name for an Ultra 10: uname -i The system responds with: SUNW,Ultra-5_10 Therefore, the system's platform name is SUNW,Ultra-5_10. The following command calls add_install_client for Ultra 10s: add_install_client -d SUNW,Ultra-5_10 sun4u For IA32 platforms, the platform name is always SUNW.i86pc. The following command calls add_install_client for IA32 platforms: add_install_client -d SUNW.i86pc i86pc install_boot_image_path Pathname of alternate miniroot, specified with -t option. The rm_install_client command supports the following operands: host_name Name of the client to be removed. platform_name The platform name of the client to be removed. See the description of this operand above. Ethernet_address Ethernet address of the client to be removed. boot_file_name Name of the boot file to be removed. The setup_install_server command supports the following operands: install_dir_path The absolute path of the directory in which the Solaris software is to be copied. The directory must be empty. wanboot_image_path The absolute path of the directory in which the file containing the WANboot miniroot image is to be created. install_boot_image_path Pathname of alternate miniroot, specified with -t option. EXAMPLES
Example 1: Using add_install_client The following add_install_client commands add clients for network installation from a mounted Solaris installation media on an install server on Solaris 9: example# cd /cdrom/cdrom0/s0/Solaris_9/Tools example# ./add_install_client system_2/sun4u Example 2: Using add_install_client The following add_install_client commands add clients for network installation from a mounted Solaris installation media on an install server. The -c option specifies a server and path to a JumpStart directory that has a rules file and a profile file for performing a custom JumpStart installation. Also, the Solaris installation media has been copied to the /export/install directory on Solaris 9: example# cd /export/install/Solaris_9/Tools example# /add_install_client -c install_server:/jumpstart system_1 i86pc example# ./add_install_client -c install_server:/jumpstart system_2 i86pc Example 3: Using add_install_client The following add_install_client command adds support for a specific sun4u platform machine (8:0:20:99:88:77) using the boot file: sun4u.solaris8. example# add_install_client -d -f sun4u.solaris8 -e 8:0:20:99:88:77 sun4u Example 4: Using add_install_client The following add_install_client command adds x86 clients that use the PXE standard for network booting: example# add_install_client -d -s svrname:/mnt/export/root SUNW.i86pc i86p Example 5: Using add_to_install_server The following add_to_install_server command copies the packages in all the installation media's products directories to an existing install server on Solaris 9: example# cd /cdrom/cdrom0/s0 example# ./add_to_install_server /export/Solaris_9 Example 6: Using check The following check command validates the syntax of the rules file used for a custom JumpStart installation: example# cd jumpstart_dir_path example# ./check -p /cdrom/cdrom0/s0 Example 7: Using rm_install_client The following rm_install_client commands remove clients for network installation on Solaris 9: example# cd /export/install/Solaris_9/Tools example# ./rm_install_client holmes example# ./rm_install_client watson Example 8: Using setup_install_server The following setup_install_server command copies the mounted Solaris installation media to a directory named /export/install on the local disk on Solaris 9: example# cd /cdrom/cdrom0/s0/Solaris_9/Tools example# ./setup_install_server /export/install Example 9: Using setup_install_server The following setup_install_server command copies the boot software of a mounted Solaris installation media to a directory named /boot_dir on a system that is going to be a boot server for a subnet on Solaris 9: example# cd /cdrom/cdrom0/s0/Solaris_9/Tools example# ./setup_install_server -b /boot_dir Example 10: Using setup_install_server By default, setup_install_server looks for an installation boot directory at the Solaris ../Tools/Boot location of the mount Solaris dis- tribution disc. If an alternate boot directory is required, such as one saved on a network boot server by way of an earlier ./setup_install_server -b /boot_dir command, the -t option can be used. example# cd /cdrom/cdrom0/s0/Solairs_9/Tools example# ./setup_install_server -t /boot_dir /export/install Example 11: Using setup_install_server with WANboot Option The following setup_install_server command creates an image of the WANboot miniroot file systemand stores it in the file /wanboot_dir/mini- root. example# cd /cdrom/cdrom0/s0/Solairs_9/Tools example# ./setup_install_server -w /wanboot_dir /export/install Example 12: x86: Specifying a Serial Console to Use During a Network Installation (from Installation Media) The following example illustrates how to add an x86 install client to an install server and specify a serial console to use during the installation. This example sets up the install client in the following manner: o The -d option indicates that the client is set up to use DHCP to set installation parameters. o The -e option indicates that this installation occurs only on the client with the ethernet address 00:07:e9:04:4a:bf. o The first and second uses of the -b option instruct the installation program to use the serial port ttya as an input and an output device. install server# cd /export/boot/Solaris_9/Tools install server# ./add_install_client -d -e "00:07:e9:04:4a:bf" -b "input-device=ttya" -b "output-device=ttya" i86pc For a complete description of the boot property variables and values you can use with the -b option, see eeprom(1M). Example 13: Specifying a Boot Device to Use During a Network Installation (from Installation Media) The following example illustrates how to add an x86 install client to an install server and specify a boot device to use during the instal- lation. If you specify the boot device when you set up the install client, you are not prompted for this information by the Device Configu- ration Assistant during the installation. This example sets up the install client in the following manner: o The -d option indicates that the client is set up to use DHCP to set installation parameters o The -e option indicates that this installation occurs only on the client with the ethernet address 00:07:e9:04:4a:bf. o The first and second uses of the -b option instruct the installation program to use the serial port ttya as an input and an output device. o The third use of the -b option instructs the installation program to use a specific boot device during the installation. o The value of the boot device path varies based on your hardware.. o The i86pc platform name indicates that the client is an x86-based system. install server# cd /export/boot/Solaris_9/Tools install server# ./add_install_client -d -e "00:07:e9:04:4a:bf" -b "input-device=ttya" -b "output-device=ttya" -b "bootpath=/pci@0,0/pci108e,16a8@8" i86pc For a complete description of the boot property variables and values you can use with the -b option, see eeprom(1M). EXIT STATUS
The following exit values are returned: 0 Successful completion. 1 An error has occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+--------------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+--------------------------------+ |Availability |Solaris CD (Installation Media) | +-----------------------------+--------------------------------+ SEE ALSO
uname(1), eeprom(1M), bootparams(4), attributes(5) Solaris 10 Installation Guide: Basic Installations SunOS 5.10 9 Sep 2004 install_scripts(1M)
All times are GMT -4. The time now is 06:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy