Today I want to show you my script, which i write while ago, and which help me with FreeBSD and Metin2 server.
It's a script/system which execute our commands like normal command line but, it also contains useful stuff e.g:
You can create safe backup of our files through simple command "create backup of mysql", you can also upload this backup to another web hosting.
You can run our server just writing "run ch 1" or "run 5 channels"
You can install e.g apache22 just through write command "install apache22"
And there are no differences when you write Run or run or RUN
There are also no differences when you write e.g 'delete logs' or 'Delete all of the LoGs '
The possibilities are many but I don't know if you'll like it
In this topic i give you a simple script which will install this system
Installation script:
Code:
http://pastebin.com/XQTRgpMj
Code:
#!/usr/local/bin python3.3
#-*- coding" utf-8 -*-
#-------------------------------------------------
#Made by Deucalion
#Hello, it's installation script to Russell system
#This script will:
# -python3.3 ~ Install one of the newest python versions
# -pymysql ~ Install library to connecting mysql with python
# -Russell ~ Download all system
# -----------MySQL---------------
# create database Russell;
# Use Russell;
# DROP TABLE IF EXISTS `lang`;
# CREATE TABLE `lang` (
# `Language` varchar(20) NOT NULL,
# PRIMARY KEY (`Language`)
# ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
# DROP TABLE IF EXISTS `privilages`;
# CREATE TABLE `privilages` (
# `id` varchar(20) NOT NULL DEFAULT '0',
# `login` varchar(20) NOT NULL,
# `password` varchar(20) NOT NULL,
# `name` varchar(20) NOT NULL,
# PRIMARY KEY (`id`)
# ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
import os
def install():
print ("Do you want to update your ports?")
choice= input("write y/n: ")
if choice == 'n':
pass
elif choice == 'y':
os.system("portsnap fetch update")
print ("Do you want to install this system?")
choice= input("write y/n: ")
if choice == 'n':
return
elif choice == 'y':
print ("Do you have already installed python3.3?")
choice_python=input("write y/n: ")
if choice_python == 'y':
pass
else:
os.system("cd /usr/ports/lang/python33 && make all install clean -DBATCH")
os.system("sleep 2")
print ("I installed python 3.3")
print ("Do you have already installed pymysql for python3.3?")
choice_pymysql=input("write y/n: ")
if choice_pymysql == 'y':
pass
else:
os.system("sleep 2")
os.system("cd / && fetch http://sysforum.tk/system/Makefile")
os.system("mv /Makefile /usr/ports/databases/py-pymysql")
os.system("cd /usr/ports/databases/py-pymysql/ && make all install clean -DBATCH")
os.system("sleep 2")
print ("I installed pymysql")
os.system("sleep 2")
os.system("cd / && fetch http://sysforum.tk/system/Russell.tar.gz")
os.system("cd / && tar zxvf Russell.tar.gz")
print ("I extracted system")
os.system("cd /bin && echo /usr/local/bin/python3.3 /Russell/Russell.pyc >> russell")
os.system("chmod -r 0555 /bin/russell")
print ("Done, now you can run it by write 'russell' in commandline but")
print ("first you must write into Russel.lang in MySQL your language")
print ("for now are 2 language available English or Polish")
print ("")
print ("Regards")
return "Deucalion"
print (install())
--------------------------------------------------------------------------
Basics
--------------------------------------------------------------------------
You run it by "russell" in our commandlineBasics
--------------------------------------------------------------------------
Some example commands:
Convert item_proto from xml to sql/txt- It will be convert our item_proto from xml to sql or txt (item_proto_dump.xml must be in /Russell/input)
Convert mob_proto - It will be convert our mob_proto from sql to txt
Delete logs - It will be delete logs from our channels
Run server - It will be run all cores and channels
Run auth - It will be run auth/DB
Run 5 channels - It will be run all cores for 5 channels
Reset 2 channel - It will be reset only second channel and his all cores
Run/stop/reset ch1 / channel 1/ - It will be run/stop/reset our first channel and this is exception becouse he will always run/stop/reset also db and auth
Add/show/delete notes - you can write some notes , view them or delete them
Update system/freebsd - It will be upgrade our system
Restart/reboot system - It will be reset our FreeBSD
Create backup of mysql, create backup of all files contains(mysql,files of Metin2 and Russells files) - Create backup and next he will ask us, if you want upload to our second hosting. He create backup with actually datetime (Later you can download this backup by command "download backup")
you can also create backup e.g only account or player database by e.g 'create backup of player'
!!Now you can connect comands by 'and'!! e.g:
"delete logs and turn ch 1 on" or "turn 2 channels and ps"
Some examples screens
--------------------------------------------------------------------------
Installation
--------------------------------------------------------------------------
You must run installation script by commandInstallation
--------------------------------------------------------------------------
Code:
python russell_instalation.py
Code:
create database Russell; Use Russell; DROP TABLE IF EXISTS `lang`; CREATE TABLE `lang` ( `Language` varchar(20) NOT NULL, PRIMARY KEY (`Language`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS `privilages`; CREATE TABLE `privilages` ( `id` varchar(20) NOT NULL DEFAULT '0', `login` varchar(20) NOT NULL, `password` varchar(20) NOT NULL, `name` varchar(20) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
and in the end you must configure Config.py you must edit your ftp account and if you have another user or password to local user, you must also edit it
If you want i will be grateful for a help with translate, you can help me by correct my mistakes in EnglishTable.py and English.py or translate this files into your languages
I think that it's all, sorry for my english, i know that it's bad but if you have any question just ask
Regards
Deucalion







