hello i have writing a shell script to download and run some packages
the only way that i use to verify download pack is , limit users ip to download from main server, if wget can download file (verified) then script run by execute it sh pack76.sh
else show and error
What are you trying to download and from where?
Also, I see a few problems with your code, for example:
is an assignment statement and won't return a boolean value (True or False), which is what you seem to need here.
Second, here
You are checking for the existence of the file pack76.sh (what is this supposed to do and what are its contents, by the way?) and if it doesn't exist you are echoing a message saying that the user doesn't have permission to perform the download operation - I believe you should have checked for permissions along with existence.
But I'm afraid I can't tell for sure just by looking at the code snippet you included in your post.
Please provide more details and a concise explanation of what you're trying to accomplish, along with the source code that you're already tried and any problems you may have encountered in the process.
i have copy part of my code that need to open this topic,
ok let me explain how i have verify :
i have add .htaccess on $mirror so if untruest machine send request to download package,only allow ip which add on .htaccess will permit to download,
i will add ips manually.
then if command will check, is file download and exist or not
if wget coud download file (allow) yes, it will open package and compile it, else, it will show warning
main part of verification is :
I insist that checking the existence of a file is not the best way to allow or deny its execution.
What I would do is wget the file, then if that command completed successfully I'd start the download operation, otherwise I'd show the error message, more like so:
Hope it helps.
I get the point of the thread owner..., what I dont understand is since he knows who are allowed ( IP list...) why not test if you are allowed to download?
I get the point of the thread owner..., what I dont understand is since he knows who are allowed ( IP list...) why not test if you are allowed to download?
mm i want to publish my script so i need verification method to know who use this script
i have not find any solution to encode-decode shell scripting so i use ip restriction by allow and deny
---------- Post updated at 02:18 PM ---------- Previous update was at 02:12 PM ----------
Quote:
Originally Posted by gacanepa
I insist that checking the existence of a file is not the best way to allow or deny its execution.
What I would do is wget the file, then if that command completed successfully I'd start the download operation, otherwise I'd show the error message, more like so:
Hope it helps.
good idea
so shell scripting do not have any protection like i need?
so what shell programmer do?
is not an assignment, and works with all sh-type shells.
But eventually give a test syntax error when $answer is empty or multi-word. Safe is
While
is an extension of the test command - not portable.
Hi guys!
Me again! ...
I'm trying to build (on MacOS directly) a bash script that will help me verify a SHA1 digest (to verify downloads and so on and so forth).
So first off, here's my version of BASH under OSX:
bash-4.4$
And here's my version of Sierra (macOS):
10.12.3 (16D32)
... (2 Replies)
Using ECDSA, how do you verify integrity of Data (D), Given the value for the following:
Random number (r)
Signature (s)
ECpublic Key (K)
Thanks. (0 Replies)
Hello again unix.com
I need some help regarding a script.
I have:
function checkform ( form )
{
if (form.pass.value.length < 6) {
alert( "Error." );
form.pass.focus();
document.getElementById('pass').style.backgroundColor="#FFFFFF";
return... (2 Replies)
Hi eveyone
I am planning to use crontab to delete all files in my donwloads directory that are older than one hour
I will be using crontab to run this script
find /home/kee/downloads/* -daystart -mmin +59 -type f -name -exec rm -r {}\;
could you please let me know if the above... (1 Reply)
Hi,
I am from File system back ground and doing File system testing on Linux, I need script that scirpt that create the different multiple types of .txt, device file and then copy to mount point /mnt/ dir and then verify the created files and copied files, if created files and copied files are... (4 Replies)
Hi,
every midnight hacmp verification is run automatically.
clverify.log says there is no erro bu clutils.log says there is 1 error but when i look at the clverify.log no problem at all.
Below is the output of the clverify.log
what may be the cause of the error in the clutils.log file.
Thanks,... (1 Reply)
hello every body,
I have to verifiy if the param_key is selectionned twice or more and to print only one occurence i'm using htable what's the good implementation to add to the code to verify this.
code :
{
char *tmpStr = NULL;
ght_iterator_t iterator_param;
void... (0 Replies)
Hi Group,
Please forgive in case this is discussed.
I need help regarding a simple script to verify if the give address exist in the Ldap directory. If the email exists the script should exit with a 0 status or else a non zero status.
I am currently using the following script (and it is... (4 Replies)
Hi,
I have a script I want to run as a background process. Where would I add a bit of script so that a check can be performed to see it this is already running and, where it isn't, to then run it? I know how to do this... I just don't know where I can put the initial part of the check script so... (2 Replies)
I'm really new at this and wondering how I would go about adding code to my script to verify that all records loaded successfully? (I am loading a file into a table) i'm using the Korn shell.
I'm also having trouble verifying parts in the header as i do not really understand the header and... (3 Replies)