PowerShell script to update application within scripti - windows

Probably a repetitive question, but need some to-the-point answers as I'm still learning. I have a script and need to update the application the script is pulling how do I go about such a thing ?
I do not know where to start I am just getting back into scripting.

Related

Is there a way to prevent a bash script from running certain commands if the script has to be run again?

I have a bash script that works at the moment. It gets an image and JDK 8 from a link and then runs a installer for the JDK 8 to move on to setting up another piece of software.
As I was debugging the script, I kept finding myself having to delete directories and even the java installation because when I introduce a fix and rerun the script, I have to wait for everything to download again and I have to worry about duplicate files messing up my current logic -which can probably be improved, but I'll go to the StackExchange Code Review site later.
At the moment, I would like to know what approaches there are to prevent commands -like downloading the JDK and running the JDK installer script all over again and others- from running again.
What kind of general approaches are out there for cases such as these?
For the JDK download and running the installer, I did think of simply checking for the existing of java on the system and if there is then bash would not not to run those commands.
However, there are other commands I do not want run and I do want to simply check, for example, the existence of certain files to prevent wget-ing them all over again and moving them -causing duplicates. (Should I maybe suck it up and do that anyway as that might be best practice?)
I did also think of perhaps, at each successful command, outputting like a 1 to a text file and mapping each line in that text file to the commands run in the script (like using an if statement to see if that command had a 1 or not in the text file) and if it was a 0, then the script would know only to run that command and never the 1s.
That sounded clunky to me and I am pretty sure that is not a good approach.

Looking for accurev clear client cache script

I was reading a post here and #chaboud commented the following:
went to an "Advanced Accurev topics" talk, and the first tidbit was a
large shell command for clearing out Accurev's client-side
caching/sync mechanism to correct for when Accurev updates silently
fail to pull down files that should be updated.
Does anyone know of this script or have a copy? I have been looking through accurev documentation and online and so far no luck on this script.
Any help would be great
Dan
I have never heard of this script and I worked for AccuRev.
I am guessing someone (outside of AccuRev) created a script which manually updates a workspace when an update would fail.

A script which runs multiple scripts within it. Need to pass the list of all the scripts executed before it to the last executed script

I have a script and within that script I am calling several other scripts.
Now I have a requirement where I need to get the list of all the scripts that have been run as I need to audit these in the database.
I have tried the history command but it does not seem to be working.
Can anyone propose any approaches that would help me.
Thank you!

Self Updating Shell Script

I am developing a gameserver shell script that has multiple smaller scripts for saving content, restarting, stopping, installing, updating, etc. Since this a script for the community, I need a way to allow me to work on it, and then push those changes to the users who use the script.
This is a basic concept of how I think it should work:
User runs the script
script downloads a version file off github
script reads the version string from github and tries to match it with the version listed in the script itself
if it doesn't match, download new script file (url never changes), replace and re-run the script
If this is something that seems possible (I assume it would), please inform me of the process.
This was demoed at docker con 2015 yesterday. But this might help. https://github.com/docker/notary

Specify password file and shadow file to update in bash script

Hi i'm currently working on a bash script on ubuntu server where i have to specify the name of password and shadow file to update when adding user. I'm wondering how do you do it? Thanks in advance!
You've known adduser or other related command. The source code of those command may be written in C. So the simple way to know how to write it in shell script, you just need to transform C code. You can find all the things you mentioned in the question.
For me, this question is strange. Usually, shell script is used to contains a series of commands, not to solve a basic problem which is already solved.

Resources