I've developed several utility scripts that solve specific problems of my team's day-to-day work.
Until now what I have done to deploy the script in my co-workers' laptops is as follows:
- Every solution has a
main.sh
script (as well as other scripts and supporting files) - Create a folder in the user's home folder and put the files there
- Add an alias either to
.bashrc
or.bash_aliases
, depending of the Linux distribution, pointing to themain.sh
script - Copy autocompletion file to
/etc/bash_completion.d/
(completion file name is the same as the alias plus.auto
extension). - Copy man page to
/usr/share/man/man1/
then gzipping it (man file name is the same as the alias plus.1
extension).
I would like to create an installer but the alias part is tricky.
- Is there a better option that would also allow for automation (installer)?
- Maybe putting a soft link to the
main.sh
file in/usr/local/bin
instead of creating aliases? - Is there a best-practice for this?
I think you are right, adding a soft link to /usr/local/bin would be much better and doing a real .deb package for your scripts
There are configuration management and automation programs that can do exactly what you need. Rather than going through all the computers and manually do the same work over and over again, you should seriously use any of the automation/orchestration tools.
Using these tools you can just create a file containg the steps and then run the file on your co-workers computer easily. As a suggestion you should try ansible first as it is easy to understand and work over SSH (Does not require any additional client program). Furthermore it has tons of other important features.
As for
/usr/local/bin
case, the other answer is right i think.