Search Results

Search: Posts Made By: greavette
Forum: Shell Programming and Scripting 2 Hours Ago
178
Posted By greavette
Thanks RudiC...your code worked perfectly! ...
Thanks RudiC...your code worked perfectly!

Thanks for the reply MadeinGermany. I needed a one liner but I'll save your example code for future reference!

Appreciate all your help.
178
Posted By greavette
Hello RudiC and thank you for this reply and...
Hello RudiC and thank you for this reply and inquiry.

The two file versions will never coexist together. It will either be:
bootstrap_cookbooks_version_green
bootstrap_cookbooks_version_red
or...
178
Posted By greavette
Assistance with my Find command to identify last part of a file name and report the name found
Hello Forum,

We have two bootstraps of Chef in our environment which are identified by colour:

/var/chef/cache/cookbooks/bootstrap_cookbooks_version_green
and...
260
Posted By greavette
Thanks very much Scrutinizer for your help! That...
Thanks very much Scrutinizer for your help! That was the bit of code that solved my issue.

Fully agree with you Neo. Now that my report is providing the information for my team as required...
260
Posted By greavette
Thank you @Neo, I am interested in moving my...
Thank you @Neo, I am interested in moving my script to another method of running. Ideally I will be using Ansible once we have that setup. For now this quick and dirty bash script I'm...
260
Posted By greavette
One Line Command how to use pipe statements to execute and comment on multiple possible outcomes
Hello Forum,

I'm looking to expand the following command:

INACTIVE_KERNELS=$(python -mplatform | grep -qi red && rpm -qa | grep '^kernel-[0-9]' |grep -vE `uname -r` | paste -sd \; || echo "Not...
511
Posted By greavette
Thanks all for the suggestions. I've decided to...
Thanks all for the suggestions. I've decided to split how I gather my information from my servers into if statements so that my here doc code gathers information from my RHEL 7.x and Ubuntu servers...
511
Posted By greavette
Bash - here document on RHEL 6.8 and 6.9 servers aren't working
H Forum,

I was thankful in getting help from this ...
496
Posted By greavette
Thanks again Chubler_XL for taking the time to...
Thanks again Chubler_XL for taking the time to reply to my post. We do have a plethora of versions still in use from RHEL 6.9 all they up to 7.7.

I did notice though on a system where I had to...
601
Posted By greavette
Hello, lsb_release was not working on my...
Hello,

lsb_release was not working on my VM's sadly.

But I've managed to make progress with the following bit of code using a case statement:

a=$(python -mplatform) && case $a in...
601
Posted By greavette
Hello again RudiC, I suppose I could use...
Hello again RudiC,

I suppose I could use lsb_release -a as a check...but what would be the one line command to check if Red Hat to run an instruction and if not Red Hat and it's Ubuntu to run a...
496
Posted By greavette
Thanks very much for this reply! I've looked at...
Thanks very much for this reply! I've looked at the MAN pages for SSH and I'm seeing the following Error codes listed on that site:

SSH Error Codes
0
Success
1
Generic error
2
Remote host...
496
Posted By greavette
Assistance with testing ssh connections and what the return codes mean
Hello Forum,

I'm using a bit of code from a script I found that allows me to capture the status code of connecting via SSH to remote servers:

ssh -qno StrictHostKeyChecking=no -o...
601
Posted By greavette
Hello RudiC, I researched how to use ls and...
Hello RudiC,

I researched how to use ls and /boot to find the distribution I was connecting to but I couldn't find a solution. But I did find another way using python that seems to be working for...
601
Posted By greavette
Another one line command where I'd like to determine if Ubuntu or Red Hat when running command
Hello Forum,

I'm making very good progress on my report thanks to the very helpful people on this forum. I've been able to successfully create my report for my Red Hat servers. But I do have a...
441
Posted By greavette
Thanks Again RudiC for your help. I'll now be...
Thanks Again RudiC for your help. I'll now be able to use the 2>/dev/null || echo "not installed" in future one line command scripts.

Your solution worked perfectly! :b:
441
Posted By greavette
Bash find version of an installed application but if none is found set variable to App Not Installed
Hello Forum,

I'm issuing a one line bash command to look for the version of an installed application and saving the result to a variable like so:

APP=application --version

But if the...
441
Posted By greavette
Hello Scrutinizer, Thank you, this was the...
Hello Scrutinizer,

Thank you, this was the command I needed! Thanks very much for your help.

Hello Neo, the command you asked me to issue on my server returned no value. But Scrutinizer...
441
Posted By greavette
Assistance with my one line command to find all inactive kernels
Hello Forum,

I'm using the following command to find all inactive kernels installed on my RHEL server:

$ rpm -qa | grep '^kernel-[0-9]' |grep -vE `uname -r`

but the result is in two lines:
...
1,704
Posted By greavette
Hello RudiC, I've continued to work on this...
Hello RudiC,

I've continued to work on this script using your suggestions and I'm very happy to report that your script suggestion has worked for me. I did as you suggested and tried your code on...
1,704
Posted By greavette
Hello RudiC, I'm finally getting around to...
Hello RudiC,

I'm finally getting around to testing the code snippets you've provided. Here is the code I've added to my script as per the suggestion. The code is allowing me to connect to the...
711
Posted By greavette
Thanks very much Jim for this quick reply. ...
Thanks very much Jim for this quick reply.

This script was created to inventory hundreds of servers I suspect they used the -o command to turn off strict host key checking so the script wouldn't...
711
Posted By greavette
Help understanding what this ls -l command is checking in a script
Hello,

we have a script that has the two following lines:

ssh -qno StrictHostKeyChecking=no -o ConnectTimeout=1 user@IP 'ls -l /home/opsmgrsvc >/dev/null 2>&1' > /dev/null 2>&1
status="$(echo...
1,704
Posted By greavette
Thank you @RudiC for the reply! Very much...
Thank you @RudiC for the reply! Very much appreciate you taking the time to review my post. I will also look into using the case statement to clean up the code readability!

For this code...
1,704
Posted By greavette
Thank you @Neo for your reply and suggestion. ...
Thank you @Neo for your reply and suggestion.

I do see the benefit in doing this on each server. From my usecase we won't have this server script on every newly built server and I only scan a...
Showing results 1 to 25 of 32

 

Featured Tech Videos

All times are GMT -4. The time now is 01:42 AM.
Unix & Linux Forums Content Copyright 1993-2019. All Rights Reserved.
Privacy Policy