Efficiently configuration, test, and manage multiple Linux servers with fh command

Photo by Kelvin Ang on Unsplash

Introduction

It is published on GitHub.

Example of using fh command

  • Automate communication confirmation that is performed many times.
  • Prepare the release work in advance, and only need to execute a few lines in the release.

Features of fh command

(1) Low learning cost (simple)

(2) Low environmental dependence

(3)Easy to solve problems on your own

(4)Once you learn, you can apply it to others

fh command Operation example

Command execution

fh -H host1 -c hostname
#Execute the hostname command on host1
fh -H host1 -p -c hostname
#Execute the hostname command on host1 with password authentication
fh -H host1,host2 -c hostname
#Execute the hostname command on host1 and host2
fh -H hostlist -c hostname
#Execute the hostname command on the host in the host list
fh -H host1 -s -c whoami
#Execute whoami command with sudo for host1
fh -H host1,host2 -s --vi FILE
#Edit files with sudo vi for host1 and host2
fh -H hostlist --ping
#Check the ping for the hosts listed in the host list

Run shell script

fh -H host1 -f test.sh
#Run test.sh on host1
fh -H host1 -f test.sh:cmd_whoami
#Run test.sh on host1.cmd_whoami is an argument

How to install fh command

~]$ curl -o fh https://raw.githubusercontent.com/kuritaka/fasthandle2/main/fhscripts/fh.sh
~]$ chmod 755 fh
~]$ sudo mv -i fh /usr/local/bin/
~]$ which fh
/usr/local/bin/fh
~]$ fh -h

If you want to use the fh command for password authentication, you need to install sshpass.

Help messages of fh command

Conclusion

--

--

Server/Network/Storage at Trading Systems | Low Latency (https://cmdref.net/)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store