#!/bin/sh echo "setident by HM2K (c) 2009 (Updated: 13/11/09)" echo " A script used to set your ident" echo oidentdconf=".oidentd.conf" setident(){ if [ ! -e $userdir ]; then echo "Directory '$userdir': does not exist, exiting..." exit 0 fi file="$userdir/$oidentdconf" if [ -e $file ]; then mv $file $file.old fi echo "Set ident for user '$user' to '$ident'" echo 'global { reply "'$ident'" }' > $file } setident_help() { echo "Usage: setident [ident]" } if [ $2 ]; then user=`pw user show $1 -q | cut -f1 -d":"` if [ ! $user ]; then echo "User $1 was not found." exit 0 fi userdir=`pw user show $1 -q | cut -f9 -d":"` ident=$2 setident chown $user:$user $userdir/$oidentdconf elif [ $1 ]; then user=$USER userdir=$HOME ident=$1 setident else setident_help fi exit 0