I found that the best way to switch pools is through cgminer API. If you have your GPUs highly overclocked, they don't really want to start every cgminer restart. With API there is no need to restart cgminer instance, unless you are switching between scrypt and sha256.
An example of adding a pool:
echo -n "addpool|stratum+tcp://stratum.give-me-ftc.com:3333,mylogin,mypass" | nc 127.0.0.1 4028
This man is on the money; and I've been toying with the best way to implement this. This is most of a script you should use for this sort of approach, but requires pools being doubled between the .conf file and this bash script depending on whether the script is starting CGminer or just switching the pools. I'd like to avoid this if possible.
#!/bin/bash
#Replace this script with one of your own.
METH=$(echo -n "coin" | nc 127.0.0.1 4028 | sed 's/.*Hash Method=\([a-z0-9]*\),.*/\1/')
echo $METH
#Kill vanityminer - inelegant, but works
killall oclvanityminer
if [ $METH == 'scrypt' ]
then
#Send the quit command to any cgminer instances running
echo "{\"command\":\"quit\"}" | nc 127.0.0.1 4028
#Start Bitcoin mining with API access enabled for the above command in the future
export DISPLAY=:0
#Set clocks
aticonfig --od-setclocks=930,300 --adapter=1
aticonfig --od-setclocks=850,300 --adapter=0
screen -dm ./../cgminer/cgminer -c ~/.cgminer/bitcoin.conf --auto-fan --api-network --api-listen --api-allow W:127.0.0.1
else
#We can just modify the pools
#Remove old pools until one left (the active one)
NPOOLS=$(echo -n "config" | nc 127.0.0.1 4028| sed 's/.*Pool Count=\([0-9]*\),.*/\1/')
echo $NPOOLS
for i in $(seq $NPOOLS -1 0)
do
echo -n "removepool|$i" | nc 127.0.0.1 4028| sed 's/.*Pool Count=\([0-9]*\),.*/\1/'
done
#Add new pools
echo -n "addpool|stratum+tcp://stratum.give-me-ftc.com:3333,mylogin,mypass" | nc 127.0.0.1 4028
#Switch to first new pool
echo -n "switchpool|1" | nc 127.0.0.1 4028
#
#Remove last old pool
echo -n "removepool|0" | nc 127.0.0.1 4028
fi
Sorry I've not been keeping tabs on Cryptoswitcher so much the last week or two - I've had other commitments, which are sadly more pressing, overtake me.