server.config

来自「公关系统服务器后台程序」· CONFIG 代码 · 共 140 行

CONFIG
140
字号
#!/bin/shecho 'please choice:'echo '1.Install system script.'echo ''echo '2.Extern server failed,work alone.'echo '3.Extern server ok,work together.'echo ''echo '4.Main server failed,Extern change to Main.'echo '5.Main server ok,Main change to Extern.'echo ''echo '6.Backup Main server data.'echo '7.Get data from Main server.'echo '8.quit'echo ""echo ""readcase "$REPLY" in	"1")		echo ""		echo "Install system script."		mv /media/vod/script/loadsd.sh /media/vod/bak/loadsd.sh		cp ./file/loadsd.sh /media/vod/script/loadsd.sh		chmod 755 /media/vod/script/loadsd.sh		echo "2" >> /media/vod/script/server.state		;;	"2")		echo ""		echo "Extern server failed,work alone."		echo "1" >> /media/vod/script/server.state		echo "Ok,restart terminal."		;;	"3")		echo ""		echo "Extern server ok,work together."		echo "2" >> /media/vod/script/server.state		echo "Ok,restart terminal."		;;	"4")		echo ""		echo "Main server failed,change Extern to Main."		echo ""		echo "4.1 copy rela file..."		cp ./file/systemcard.main /managePlat/update/systemcard		cp ./file/guardgui.main /managePlat/update/guardgui		echo "4.2 restart network..."		cp ./file/ifcfg-eth0.main /etc/sysconfig/network-script/ifcfg-eth0		service network restart		echo "4.3 start database..."		chkconfig --level 3 mysql on		service mysql start				echo "4.4 start dhcp..."		chkconfig --level 3 dhcpd on		service dhcpd start		echo "4.5 ok,please install system card"		echo "machine will shutdown after 5 second."		sleep 5		shutdown -h now		;;	"5")			echo ""		echo "Main server ok,change Extern to Main."		echo "5.1 copy rela file..."		cp ./file/systemguard.extern /managePlat/update		cp ./file/guardgui.extern /managePlat/update		echo "5.2 restore network config..."		cp ./file/ifcfg-eth0.extern /etc/sysconfig/network-script/ifcfg-eth0		service network restart				echo "5.3 stop database..."		chkconfig --level 3 mysql off		service mysql stop				echo "5.4 stop dhcp..."		chkconfig --level 3 dhcpd off		service dhcpd stop		echo "5.5 ok,please unistall system card."		echo "machine will shutdown after 5 second."		sleep 5		shutdown -h now		;;	"6")		echo ""		echo "Backup Main data."		if test -d /managePlat/sdata ; then			mkdir /managePlat/sdata			chown jetsic.jetsic /managePlat/sdata		fi		tar -cf /managePlat/sdata/ktv.dat /var/lib/mysql/firebird_ktv		tar -cf /managePlat/sdata/vod.dat /var/lib/mysql/jetvod		echo "Ok,backup finish..."		;;	"7")		echo ""		echo "Get Data from Main."		ftpcopy -h 192.168.0.254 -u jetsic -p jetsic ktv.dat ./file/ktv.dat		if test ! $? = 0 ; then			echo 'get ktv data failed'		fi		ftpcopy -h 192.168.0.254 -u jetsic -p jetsic vod.dat ./file/vod.dat		if test ! $? = 0 ; then			echo 'get vod data failed'		fi		if test -d /managePlat/sdata ; then			mkdir /managePlat/sdata			chown jetsic.jetsic /managePlat/sdata		fi		if test ! -f /managePlat/sdata/ktv.dat ; then			tar -cf /managePlat/sdata/ktv.dat /var/lib/mysql/firebird_ktv			tar -cf /managePlat/sdata/vod.dat /var/lib/mysql/jetvod		fi		if test -f ./file/ktv.dat ; then			tar -xf ./file/ktv.dat -C /var/lib/mysql			rm -f ./file/ktv.dat		fi		if test -f ./file/vod.dat ; then			tar -xf ./file/vod.dat -C /var/lib/mysql			rm -f ./file/vod.dat		fi		echo 'Ok,finish update Extern data.'		;;	"8")		echo "quit."		;;esac

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?