X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=clients%2FHP%2Fbin%2Fswitch_rgy;fp=clients%2FHP%2Fbin%2Fswitch_rgy;h=ded8c03fdcf2042d1a4545ecf35e8b1d273d9cde;hb=a8c84d2892f07a6863b68a11eb0a4a79ffd71fb5;hp=0000000000000000000000000000000000000000;hpb=95384f94f88aceeb5eef2d322210ba4a438b6512;p=clearscm.git diff --git a/clients/HP/bin/switch_rgy b/clients/HP/bin/switch_rgy new file mode 100644 index 0000000..ded8c03 --- /dev/null +++ b/clients/HP/bin/switch_rgy @@ -0,0 +1,48 @@ +#!/bin/ksh +################################################################################ +# +# File: switch_rgy +# Description: A script to switch the registry host from one machine to +# another. +# Author: Andrew DeFaria, California Language Labs +# Created: Wed Jan 15 16:52:22 PST 1997 +# Modified: Wed Jan 15 16:52:22 PST 1997 (Andrew DeFaria) defaria@cup.hp.com +# Language: Korn Shell +# +# (c) Copyright 2001, Andrew@DeFaria.com, all rights reserved +# +################################################################################ +me=$(basename $0) + +function usage { + print "Usage: $me: " + exit 1 +} # usage + +if [ $(id -u) -ne 0 ]; then + print -u2 "$me: Error: Must be root to execute this command!" + usage +fi + +# Get parameters +if [ $# -ne 1 ]; then + usage; +else + new_registry_server="$1" +fi + +registry_host_file=/usr/adm/atria/rgy/rgy_hosts.conf + +if [ -f $registry_host_file ]; then + old_registry_server=$(cat $registry_host_file) + if [ "$old_registry_server" = "$new_registry_server" ]; then + print -u2 "$me: The registry server is already $new_registry_server" + print -u2 "$me: Nothing changed!" + exit + fi + cp $registry_host_file $registry_host_file.old + print $new_registry_server > $registry_host_file + print "$me: Switched registry server from $old_registry_server \c" + print "to $new_registry_server." + print "$me: Saved old registry setting in $registry_host_file.old" +fi