#!/bin/sh
#
# This is an example bourne shell script to be run after installation.
# It sets the system's root password to the entry defined in PASSWD.
# The encrypted password is obtained from an existing root password entry
# in /etc/shadow from an installed machine.

echo "setting password for root"

# set the root password
PASSWD=THE_ROOT_PASSWD
mv /a/etc/shadow /a/etc/shadow.orig
sed -e "s/root::6445:/root:$PASSWD:6445:/" /a/etc/shadow.orig > /a/etc/shadow
chmod 400 /a/etc/shadow

# set the flag so sysidroot won't prompt for the root password
sed -e 's/0	# root/1	# root/' ${SI_SYS_STATE} > /tmp/state.$$
mv /tmp/state.$$ ${SI_SYS_STATE}
chmod 644 ${SI_SYS_STATE}