Jump to content
×
×
  • Create New...

[BSD]Script de reload !


Recommended Posts

Bonjour,

 

Aujourd'hui je vous propose un nouveau script de reload pour vos files.

 

Il a été codé par moi même.

 

 

Ce script sert à reload votre database et files. Il permet d'éviter les reboot à chaque fois que vous modifiez/modifierai quelque chose.

Il vous propose aussi de restart vos files.

 

 

Le code pour ceux qui veulent jeter un vite coup d'œil:

### Script reboot et reload By Mechanical for Mt2-Shop ###
#!/bin/sh

clear
echo -e "\033[36mCe script va couper la connexion de vos files et les redemarrer.\033[0m"
echo -e "\033[36mCe script est utile dans le reload de serveur.\033[0m"
sleep 2
clear
echo -e "\033[36mLancement du script..\033[0m"
echo -e "\033[36m..\033[0m"
sleep 1
echo -e "\033[36m..\033[0m"
sleep 1
clear
sleep 2
echo -e "\033[32mSouhaitez vous lancer le script ?\n 
1 - (1) Oui \n 
2 - (2) Non \033[0m"

read chs
case $chs in

### Choix 1 Script ###
1*)	
clear
echo -e "\033[32m           ================================\033[0m"
echo -e "\033[32m           = Reload de Mysql et du Server =\033[0m"
echo -e "\033[32m           ================================\033[0m"
clear
sleep 2
killall -9 game
killall -9 db
sleep2
clear
echo -e "\033[32m                =========================    \033[0m"
echo -e "\033[32m                = Reload de la database =    \033[0m"
echo -e "\033[32m                =========================    \033[0m"
sleep 2
clear
service mysql-server restart
sleep 2
clear
echo -e "\033[32m             =============================    \033[0m"
echo -e "\033[32m             = Database et Server reload =    \033[0m"
echo -e "\033[32m             =============================    \033[0m"
sleep 5
clear
echo -e "\033[33m Voulez vous lancer vos files ?

1 - (1) Oui \n

2 - (2) Non\033[0m"

### Choix lancement ###
read chs
case $chs in


### Choix 1 Lancement ###
1*)
	sleep 2
	clear
	echo -e "\033[32mDemarrer combien de channel(s) ?\033[0m"

	echo -e "\033[33m
	1 - (1) Channel

	2 - (2) Channels

	3 - (3) Channels

	4 - (4) Channels\033[0m"

	read chs
	case $chs in


	1*)
		clear
		echo -e "\033[32mDemarrage de 1 channel..\033[0m"
		sleep 2
		clear
		cd ./db/
		./db &
		sleep 2
		cd ../auth 
		./auth &
		sleep 2
		cd ../channel1/core1/
		./game_ch1_1 &
		sleep 2
		cd ../core2/
		./game_ch1_2 &
		sleep 2
		cd ../core3/
		./game_ch1_3 &
		sleep 2
		cd ../core4/
		./game_ch1_4 &
		sleep 2
		cd ../core5/
		./game_ch1_5 &
		sleep 2
		cd ../../game99/
		./game_99 &
		sleep 2
		cd ..
		sleep 2
		clear
		echo -e "\033[32mChannel 1 actif !\033[0m"
		sleep 5
		clear
	;;	
	2*	)
		clear
		echo -e "\033[32mDemarrage de 2 channels..\033[0m"
		sleep 2
		clear
		cd ./db/
		./db &
		sleep 2
		cd ../auth 
		./auth &
		sleep 2
		cd ../channel1/core1/
		./game_ch1_1 &
		sleep 2
		cd ../core2/
		./game_ch1_2 &
		sleep 2
		cd ../core3/
		./game_ch1_3 &
		sleep 2
		cd ../core4/
		./game_ch1_4 &
		sleep 2
		cd ../core5/
		./game_ch1_5 &
		sleep 2
		cd ../../channel2/core1/
		./game_ch2_1 &
		sleep 2
		cd ../core2/
		./game_ch2_2 &
		sleep 2
		cd ../core3/
		./game_ch2_3 &
		sleep 2
		cd ../core4/
		./game_ch2_4 &
		sleep 2
		cd ../core5/
		./game_ch2_5 &
		sleep 2
		cd ../../game99/
		./game_99 &
		sleep 2
		cd ..
		sleep 2
		clear
		sleep 2
		echo -e "\033[32mChannel 2 actif !\033[0m"
		sleep 5
		clear
	;;
	3*)
		clear
		echo -e "\033[32mDemarrage de 3 channels..\033[0m"
		sleep 2
		clear
		cd ./db/
		./db &
		sleep 2
		cd ../auth 
		./auth &
		sleep 2
		cd ../channel1/core1/
		./game_ch1_1 &
		sleep 2
		cd ../core2/
		./game_ch1_2 &
		sleep 2
		cd ../core3/
		./game_ch1_3 &
		sleep 2
		cd ../core4/
		./game_ch1_4 &
		sleep 2
		cd ../core5/
		./game_ch1_5 &
		sleep 2
		cd ../../channel2/core1/
		./game_ch2_1 &
		sleep 2
		cd ../core2/
		./game_ch2_2 &
		sleep 2
		cd ../core3/
		./game_ch2_3 &
		sleep 2
		cd ../core4/
		./game_ch2_4 &
		sleep 2
		cd ../core5/
		./game_ch2_5 &
		sleep 2
		cd ../../channel3/core1/
		./game_ch3_1 &
		sleep 2
		cd ../core2/
		./game_ch3_2 &
		sleep 2
		cd ../core3/
		./game_ch3_3 &
		sleep 2
		cd ../core4/
		./game_ch3_4 &
		sleep 2
		cd ../core5/
		./game_ch3_5 &
		sleep 2
		cd ../../game99/
		./game_99 &
		sleep 2
		cd ..
		clear
		sleep 2
		echo -e "\033[32mChannel 2 actif !\033[0m"
		sleep 5
		clear
	;;
	4*)
		clear
		echo -e "\033[32mDemarrage de 4 channels..\033[0m"
		sleep 2
		clear
		cd ./db/
		./db &
		sleep 2
		cd ../auth 
		./auth &
		sleep 2
		cd ../channel1/core1/
		./game_ch1_1 &
		sleep 2
		cd ../core2/
		./game_ch1_2 &
		sleep 2
		cd ../core3/
		./game_ch1_3 &
		sleep 2
		cd ../core4/
		./game_ch1_4 &
		sleep 2
		cd ../core5/
		./game_ch1_5 &
		sleep 2
		cd ../../channel2/core1/
		./game_ch2_1 &
		sleep 2
		cd ../core2/
		./game_ch2_2 &
		sleep 2
		cd ../core3/
		./game_ch2_3 &
		sleep 2
		cd ../core4/
		./game_ch2_4 &
		sleep 2
		cd ../core5/
		./game_ch2_5 &
		sleep 2
		cd ../../channel3/core1/
		./game_ch3_1 &
		sleep 2
		cd ../core2/
		./game_ch3_2 &
		sleep 2
		cd ../core3/
		./game_ch3_3 &
		sleep 2
		cd ../core4/
		./game_ch3_4 &
		sleep 2
		cd ../core5/
		./game_ch3_5 &
		sleep 2
		cd ../../channel4/core1/
		./game_ch4_1 &
		sleep 2
		cd ../core2/
		./game_ch4_2 &
		sleep 2
		cd ../core3/
		./game_ch4_3 &
		sleep 2
		cd ../core4/
		./game_ch4_4 &
		sleep 2
		cd ../core5/
		./game_ch4_5 &
		sleep 2
		cd ../../game99/
		./game_99 &
		sleep 2
		cd ..
		clear
		sleep 2
		echo -e "\033[32mChannel 4 actif !\033[0m"
		sleep 5
		clear
	;;
	esac
;;
2*)
	clear
	sleep 2
	echo -e "\033[36mA plus tard !\033[0m"
	sleep 2
	clear
;;
esac
;;
2*)
clear
sleep 2
echo -e "\033[36mDommage\033[0m"
sleep 2
clear
;;
esac
 

 

 

Il est vrai que j'aurais pu faire plus simple en redirigeant vers un sh start.sh, mais c'est le début d'un gros script qui gèrera tout (sh start.sh, sh close.sh, sh reload.sh, sh clear.sh, sh quest.sh).

 

 

Cordialement.

Edited by KitKat
Link to comment
  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.