#!/bin/sh # This script will rename your solaris hostname # sys-unconfig can also be used, however it will also remove your root password # alter your IP and host resolution. # by: Hermelito Go if [ $# -eq 0 ] then echo "USAGE: $0 newhostname" fi OLDHOST=`hostname` for FILE in /etc/hosts /etc/nodename /etc/hostname.*e0 /etc/net/tic*/hosts do cp $FILE $FILE.bak sed -e "s/$OLDHOST/$1/" $FILE.bak >$FILE done