USAGE for gen_sudoers.sh v1.0.2: gen_sudoers.sh {-fs|-ls} [-y [-f]] [-L ] [-D] or gen_sudoers.sh [-h|-man] DESCRIPTION: This script generates a sudoers file for the OS user that owns /p4/common, which is expected to be the same user that the Perforce Helix Core service runs as (typically 'perforce'). By default, the sudoers file is generated for review. If the '-y' option is specified, the newly generated files is installed as the live sudoers file by copying to /etc/sudoers.d/ and adjusting permissions to 0400. If '-fs' (full sudo) is specified, a one-line sudoers file is generated that looks something like this: perforce ALL=(ALL) NOPASSWD: ALL If '-ls' is specified, a limited sudoers file is generated granting only necessary access to the perforce user. If the sudoers file already exits, it will not be updated unless '-f' (force) is proivided. OPTIONS: -fs Specify that a full sudo file is to be generated. The '-fs' or '-ls' option must be specified. -ls Specify that limited sudoers file is to be generated. The '-fs' or '-ls' option must be specified. -y This is confirmation to install the generated sudoers as the live sudoers file. -f Specify '-f' to overwite an existing limited sudoers file, /etc/sudoers.d/ -L Specify the path to a log file, or the special value 'off' to disable logging. By default, all output (stdout and stderr) goes to: /home/perforce/gen_sudoers..log NOTE: This script is self-logging. That is, output displayed on the screen is simultaneously captured in the log file. -D Enable bash 'set -x' extreme debugging verbosity. HELP OPTIONS: -h Display short help message -man Display man-style help message EXAMPLES: EXAMPLE 1: Generate a limited sudoers file for review. cd /p4/sdp/Server/Unix/setup ./gen_sudoers.sh -ls EXAMPLE 2: Generate a limited sudoers file and install it. cd /p4/sdp/Server/Unix/setup ./gen_sudoers.sh -ls -y EXAMPLE 3: Generate a limited sudoers file and install it, replacing an existing one. cd /p4/sdp/Server/Unix/setup ./gen_sudoers.sh -ls -f -y EXAMPLE 4: Generate a full sudoers file and install it, replacing an cd /p4/sdp/Server/Unix/setup ./gen_sudoers.sh -fs -f -y