#! /bin/bash

path='/usr/local/tengine/conf/rewrite'

ls -la $path | grep conf | awk {'print $9'} >/var/tmp/file

cd $path

while read line
do
	echo "update file: $line"
	
	cp -p $line $line."bak"
	
	cat /tmp/js.txt >>"$path/$line"
	
done < /var/tmp/file

/usr/local/tengine/sbin/nginx -s reload

echo "restart nginx ok!";