Efficiently configuration, test, and manage multiple Linux servers with fh command
I made a tool in bash to deploy to a remote server like Python Fabric.
With a few simple options, you can run commands or run shell scripts against the remote server. You can efficiently configure and test multiple Linux servers.
It is published on GitHub.
Example of using fh command
- Execute the same command for multiple servers.
- 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)
The fh command is a simple option that you can easily understand by looking at “fh -h”. Almost no preparation required, ready to use
(2) Low environmental dependence
The fh command is made up of shell scripts and is less environment dependent. Just copy and paste the code and it will work anywhere. It should be usable after 10 years.
(3)Easy to solve problems on your own
It’s a shell script that runs, so it’s easy to find out why it didn’t work when something went wrong.
(4)Once you learn, you can apply it to others
The fh command executes a shell script, so it is necessary to be able to write a shell script. IT Engineers need the ability to freely write shell scripts for backups, alerts, and other automation, so let’s master it.
fh command Operation example
The fh command has various options. The basic operation is as follows
fh -H host1 -c hostname
#Execute the hostname command on host1fh -H host1 -p -c hostname
#Execute the hostname command on host1 with password authenticationfh -H host1,host2 -c hostname
#Execute the hostname command on host1 and host2fh -H hostlist -c hostname
#Execute the hostname command on the host in the host listfh -H host1 -s -c whoami
#Execute whoami command with sudo for host1fh -H host1,host2 -s --vi FILE
#Edit files with sudo vi for host1 and host2fh -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 host1fh -H host1 -f test.sh:cmd_whoami
#Run test.sh on host1.cmd_whoami is an argument
How to install fh command
If you have administrator privileges:
(You don’t need to have administrator privileges because you only need to put one file. Read README.md on GitHub for more information.)
~]$ 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
~]$ fh -h
If you want to use the fh command for password authentication, you need to install sshpass.
Help messages of fh command
Do you like the fh command?
It’s ready to use, so let’s try it first.
Please read README.md on GitHub for more information.