My family is using several voip services from the betamax family. To make sure that everything is not running too low on credit I would like to use the following script ( http://www.timedicer.co.uk/programs/help/dellmont-credit-checker.sh.php#Description ) in crontab so this check can be scheduled...
I tried to get this running on my Clearos 6.5 machine by putting the script in the /var/www/<voip_dir> location with the appropriate rights, but I need some help to get things going...
Can someone confirm that CGI is standard available including the following dependencies (awk, bash, coreutils, curl, grep, openssl, sed, [sendmail], umask). New to this how to check this,..
I tried to get this running on my Clearos 6.5 machine by putting the script in the /var/www/<voip_dir> location with the appropriate rights, but I need some help to get things going...
Can someone confirm that CGI is standard available including the following dependencies (awk, bash, coreutils, curl, grep, openssl, sed, [sendmail], umask). New to this how to check this,..
Share this post:
Responses (7)
-
Accepted Answer
So it works.... (and it is perfect)
If 2 helpfull people stating that they only have 544 lines, I did something wrong (downloaded it initially via windows and uploaded it via WinSCP to my machine)... What I don't know exactly, but I decided it to download it via Wget directly. Almost instant succes, because after creating the .conf file, it verifies my accounts in a few seconds. Great !
Working on some details now. Again thanks for supporting in this. Super ! -
Accepted Answer
Like Nick I only downloaded 544 lines. However, the last line is missing a line feed. On linux files they should end with just line feed - no carriage returns whatsoever.
Adding a line feed now makes mine 545 lines. Without an account the script cannot be tested properly... i.e. using a dummy conf file.. - but no script errors...
[root@alex ~]# ./dellmont-credit-checker.sh
dellmont-credit-checker.sh v4.4.1 [29 Jun 2016] by Dominic
==========================
www.voipdiscount.com myaccount for credit >300 cents: Error: www.voipdiscount.com / myaccount - CREDITCENTS is blank
Error 11 occurred for www.voipdiscount.com myaccount
[root@alex ~]#
@stasses How did you download the script - I used a linux workstation and Firefox which provided a direct download. Chrome wanted to display the script on the screen. To 'Copy and Paste' on such a long file would be a difficult way to get exactly right, especially as one line is 296 characters, and there are others almost as long :-( Suspect that perhaps your file is longer as some of the long lines have 'wrapped'? -
Accepted Answer
-
Accepted Answer
Indeed a bit Weird...
sh-4.1# ./dellmont-credit-checker.sh
./dellmont-credit-checker.sh: line 563: unexpected EOF while looking for matching `''
./dellmont-credit-checker.sh: line 565: syntax error: unexpected end of file
But the script is only 564 line. No scripting skills on this side and google on the errors does not supply the solution yet -
Accepted Answer
Thank you for your help so far... I do have the dev-tools installed also, but nevertheless good to know how to check if something is available. Still to do the check...
Tried to run this from the command line but without success. Issue on line 563/565 which is at the end of the script.. Then I tried to use my local web server but also no success. Therefore I m currently here.... -
Accepted Answer
You can check for installed functions with something like "which function_name" or "rpm -qa | grep function_name". The first tests for an executable, the second for an installed package. I suspect they are all in ClearOS but I have all teh development tools installed as well so I can't say how each package got there. Most are basic but I'm not sure about coreutils.
It looks like it should be run as a cron job and not in the web server. Try just sticking it somewhere, giving it execute permissions and then running it manually in a console.
[edit]
Rather than use crontab, it is easier to put it somewhere like /etc/cron.daily and ClearOS will look after it on its daily schedule
[/edit]
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.
Register Here »