脚本如下:
#!/bin/bash
s=1
port=1
a_address=0
b_address=0
c_address=0
d_address=0
while [ $s != 9000000 ]
do
s=$(($s+1))
port=$(($port+1))
a_address=$(($a_address+1))
b_address=$(($b_address+1))
c_address=$(($c_address+1))
d_address=$(($d_address+1))
psqldatabase sysuser --command "UPDATE gateway set ip_addr = '$a_address.$b_address.$c_address.$d_address',ip_port = '$port',real_ip_addr = '$a_address.$b_address.$c_address.$d_address',activate = 't' WHERE serial = 'le4nin9'";
if [ $port = 65535 ]; then port=1
fi
if [ $a_address = 255 ]; then a_address=0
fi
if [ $b_address = 255 ]; then b_address=0
fi
if [ $c_address = 255 ]; then c_address=0
fi
if [ $d_address = 255 ]; then d_address=0
fi
echo $s >sql.log
done
s=1
port=1
a_address=0
b_address=0
c_address=0
d_address=0
while [ $s != 9000000 ]
do
s=$(($s+1))
port=$(($port+1))
a_address=$(($a_address+1))
b_address=$(($b_address+1))
c_address=$(($c_address+1))
d_address=$(($d_address+1))
psqldatabase sysuser --command "UPDATE gateway set ip_addr = '$a_address.$b_address.$c_address.$d_address',ip_port = '$port',real_ip_addr = '$a_address.$b_address.$c_address.$d_address',activate = 't' WHERE serial = 'le4nin9'";
if [ $port = 65535 ]; then port=1
fi
if [ $a_address = 255 ]; then a_address=0
fi
if [ $b_address = 255 ]; then b_address=0
fi
if [ $c_address = 255 ]; then c_address=0
fi
if [ $d_address = 255 ]; then d_address=0
fi
echo $s >sql.log
done
继续观察了。总之对Postgres有些灰心了,想把系统的数据库转到Oracle去。