pkgcond man page on SunOS

Man page or keyword search:  
man Server   20652 pages
apropos Keyword Search (all sections)
Output format
SunOS logo
[printable version]

pkgcond(1M)		System Administration Commands		   pkgcond(1M)

NAME
       pkgcond - determine type and capability of target

SYNOPSIS
       /usr/bin/pkgcond [-nv] condition

DESCRIPTION
       The  pkgcond  command  allows you to determine the type of target being
       operated on (global zone, non-global  zone,  diskless  client,  and  so
       forth)  and the capabilities available for that type of client (can add
       a driver, path is writable, and	so  forth).  The  pkgcond  command  is
       intended	 to be invoked from package and patch scripts, but can also be
       used in situations that mimic the context of these scripts.  See	 NOTES
       for further guidance.

       pkgcond	has  one  mandatory  argument,	a condition. The command tests
       whether the condition is true for the specified path. The condition can
       be one of the following:

	   o	  can_add_driver [path]

	   o	  can_remove_driver [path]

	   o	  can_update_driver [path]

	   o	  is_alternative_root [path]

	   o	  is_boot_environment [path]

	   o	  is_diskless_client [path]

	   o	  is_global_zone [path]

	   o	  is_mounted_miniroot [path]

	   o	  is_netinstall_image [path]

	   o	  is_nonglobal_zone [path]

	   o	  is_path_writable path

	   o	  is_running_system [path]

	   o	  is_sparse_root_nonglobal_zone [path]

	   o	  is_what [path]

	   o	  is_whole_root_nonglobal_zone [path]

       The  path  argument usually denotes the root of the global zone or non-
       global zone, or alternate root. If path is optional and not  specified,
       the default is /.

       The  behavior  of the is_what condition is somewhat special, because it
       displays results of all other conditions to standard output.

OPTIONS
       The following options are supported:

       -n

	   Negate return status (0 becomes 1 and  1  becomes  0).  It  negates
	   results in the case of is_what condition.

       -v

	   Verbose mode. Displays detailed data about intermediate checks per‐
	   formed.

EXAMPLES
       Example 1 Listing All Available Information

       The following command lists all available information about the current
       running system, in a user-friendly way.

	 example# pkgcond -n is_what

       Example 2 Determining if Target is an Alternate Root

       The  following command determines whether an alternate boot environment
       exists under /altroot_mount.

	 example# pkgcond is_alternative_root /altroot_mount

EXIT STATUS
       0

	   Condition is true unless -n was specified.

       1

	   Condition is false unless -n was specified.

       2

	   Command line usage error.

       3

	   Command failed to perform the test due to a fatal error.

ATTRIBUTES
       See attributes(5) for descriptions of the following attributes:

       ┌─────────────────────────────┬─────────────────────────────┐
       │      ATTRIBUTE TYPE	     │	    ATTRIBUTE VALUE	   │
       ├─────────────────────────────┼─────────────────────────────┤
       │Availability		     │SUNWcs			   │
       ├─────────────────────────────┼─────────────────────────────┤
       │Interface Stability	     │Uncommitted		   │
       └─────────────────────────────┴─────────────────────────────┘

SEE ALSO
       pkgtrans(1), pkgadd(1M), pkgask(1M), pkgchk(1M), pkgrm(1M), pkginfo(4),
       attributes(5)

NOTES
       Supported usage of pkgcond is subject to the following constraints:

	   1.	  Do  not use pkgcond outside of the Solaris marketing release
		  in which it is provided (for example, do not use Solaris  10
		  pkgcond against a Solaris 9 target).

	   2.	  Restrict  use of the optional path argument according to the
		  following rules:

	       o      The command pkgcond condition $ROOTDIR can  be  used  in
		      patch level scripts.

	       o      The  command  pkgcond condition $PKG_INSTALL_ROOT can be
		      used in package level scripts.

	       o      A command of the	form  pkgcond  condition  without  the
		      optional path argument can be used in any context.

       Use  of	pkgcond	 with an arbitrary path argument is not recommended or
       supported, as the results returned might not be accurate.

SunOS 5.10			  20 Oct 2009			   pkgcond(1M)
[top]

List of man pages available for SunOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net