linux script which will query mysql db, call a command with parameters, update db based on results
$30-250 USD
Closed
Posted over 5 years ago
$30-250 USD
Paid on delivery
alter table [login to view URL]
if the following cols dont exist add
z_rech_code string 10 chars
z_suc_msg string 100 chars
z_min number like 999999.32
z_warn integer 2 dig default 1
Z_tries integer 2 digit default 0
z_last_topup_date date
z_last_topup_run date default is create date
z_enabled 0 or 1
z_ussd_1 string up to 100 dig
z_ussd_1_return string up to 100
z_ussd_2 string up to 100
Z_ussd_2_return string up to 100
z_rech_notes string up to 200
select ip,channel,sim from [login to view URL] where balance_date > 10 min ago and balance < z_min and z_warn > z_tries
you will receive values like
[login to view URL] 5 1
[login to view URL] 5 5
[login to view URL] 4 1
etc
for each entry received
issue
php /var/www/html/gateway/[login to view URL] --ussd --gw [IP] --ports [channel].[sim] --ussd-code [z_rech_code][card]#
mark z_tries=z_tries+1
card we get by doing
select card from goip.recharge_card where used='0' order by rand() limit 1;
wait up to 3 minutes for a reply and write that reply to z_rech_notes
if any part of the reply has a string that matches z_suc_msg - update recharge card and set its used='1'
if you received a reply but the string does not match update recharge and set its used=2
if you recevied no reply, do not update used
after 3 min wait
check if there are entries in z_ussd_1 and z_ussd_2
entries can be like
z_ussd_1 = *223#,*111#,#545*
z_ussd_2 = '*4545#, *554#
if entries are present issue them like
php /var/www/html/gateway/[login to view URL] --ussd --gw [IP] --ports [channel].[sim] --ussd-code [value]
php /var/www/html/gateway/[login to view URL] --ussd --gw [IP] --ports [channel].[sim] --ussd-code [value2]
php /var/www/html/gateway/[login to view URL] --ussd --gw [IP] --ports [channel].[sim] --ussd-code [value3]
etc
each comma indicates a new value, in example above z_ussd_1 has 3 values and z_ussd_2 has 2 values
Wait 30 seconds after you issue and if you get a reply, write this in z_ussd_[X]_return
entries who have unique channels may be processed simultaneously
Expect that the entire project will require 50% more work than stated here. Just in case i forgot anything.
Sample script can be seen at
[login to view URL]
Hello!
I can help you to develop a Linux script according to your requirements.
As for me I'm a professional system admin with 10+ years of experience. Check my reviews. Recently I've successfully completed several projects where created various bash and shell scripts. See references below:
- script that can automatically install LAMP on Linux servers https://www.freelancer.com/projects/linux/Bash-script-setup-LAMP-stack/
- script that automatically creates proxy servers https://www.freelancer.com/projects/linux/Detailed-Guide-setup-proxies-IPv/ https://www.freelancer.com/projects/php/Squid-Proxy-Script-Multiple-with/ https://www.freelancer.com/projects/linux/Guide-Script-making-rotating-web/ https://www.freelancer.com/projects/linux/Proxy-script-with-luminati/
I'm a real expert on this. I can help you too. Let's discuss the details in private chat. Feel free to contact me.
Hi ! I'm interested in your project. You need to query mysql and run specific actions on result. I can achieve this in the language you need. I work in Linux world for 20 years and can do this with shell / php, or replace shell by perl as you want (I'm a CPAN author / tester and I'm part of AUTHORS of Perl).
Ping me for any question.
Have a good day.
Hey
I'm a System Engineer with coding skills.
I had coded tons of scripts for Linux environments.
I have the required skills and experience in SQL, Shell scripting.
I can help.
Regards.
Hello,
I can write the below script in linux and i can run it with cron or manually as you want. Please let me know if you need anything. Waiting for your reply. Thank you
Hi
I am an devops engineer experienced shell scripting, python scripting and PHP for more than 4 years. I am also experienced in using scrpting languages to query mysql database and automate processes. I can do this for you. Please message to discuss further on this.
Thanks
Note-please check my profile for past project and reviews.
Hi,
I experienced on PHP, MYSQL and also Linux shell script.
For your project description, I think I can combine it.
I can create the script, I need the sample database
And since I just finish on my last project, so I can start your project today.
Hi!
I am IT expert and I have a lot of experience in creating scripts for linux.
I used to develop scripts with bash, python, php, perl.
I'll be glad to help you!
Thank you!
Hi i am interested for this project and i have good enough skills on writing shell script and accessing mysql database.
Please have a look on my previous projects and let me know your interest.
Thank you!
I am confident I am the right candidate for this project as I have done many similar projects in the past. With years of experience in this field, I believe this project will be very easy for me.
Dear Sir,
I like solving complicated problems and making the things easier for the other people.
In order to achieve this, I have more than 18 years of experience as a IT professional. I have an extraordinary ability and motivation not to give when the situation becomes difficult. On the opposite, I become one with the situation and I find solutions where most of other professionals are holding themselves back.
Please contact me for more details in order to discuss the way to move forward.
Kind Regards
Nikolaos
Hello Client,
Hope you are doing good. I am having 6 years of IT experience and currently on Christmas Vacation and looking forward to do some extra work.
As mentioned earlier about my IT experience, I have been writing Shell and Batch Scripting for the leading MNC of the world.
Looking upon my experience, I think I am the best possible match for this position.
Please let me know if you would like to avail my services.