stephen.hindmarch at bt.com stephen.hindmarch at bt.com
Wed Oct 31 04:49:06 PDT 2007
Dominik,

Its as straightforward as you might think. Here is a fragment of a bash
script that I use as part of my application. This function issues the
subscribe set command to bring a new subscribing node into the system
and get its replication from a particular provider node. In this
application there is only one set (set 1) but you could extend the
principle to cover multiple sets.

## Subscribe
subscribe(){
    provider=$1
    subscriber=$2
    if test ${provider} -eq ${subscriber};then
	return
    fi
    slonik <<EOF
include <$conf_file>;
echo 'Subscribing ${subscriber} to ${provider}';
subscribe set
(id=1,provider=$provider,receiver=$subscriber,forward=yes);
echo 'Done';
EOF
}

Steve Hindmarch
BT Design

> -----Original Message-----
> From: slony1-general-bounces at lists.slony.info 
> [mailto:slony1-general-bounces at lists.slony.info] On Behalf Of 
> Dominik Klein
> Sent: 31 October 2007 08:20
> To: slony1-general at lists.slony.info
> Subject: [Slony1-general] How to pass parameters to a slonik script?
> 
> Hi
> 
> (how?) is it possible to pass parameters to a slonik script?
> 
> Like in a bash script
> 
> #!/bin/bash
> echo $1
> 
> and then "./script.sh test" would output "test".
> 
> Regards
> Dominik
> _______________________________________________
> Slony1-general mailing list
> Slony1-general at lists.slony.info
> http://lists.slony.info/mailman/listinfo/slony1-general
> 


More information about the Slony1-general mailing list