I need to modify one of my scripts. Until now it has two obligatory parameters which point out to version of update and database where this update is going to be applied
./script.sh version db_name
Now I want to add two new optional parameters, in fact I should call it switches. These switches extend it to : 1. before install stop (or not) my web server 2. install also some new files to filesystem Both of the returns bool value. All details are inside the script. So i expect something like:
./script.sh version db_name -stopweb -copyfiles
I have figured out getopts is suitable command. The problem is how to "join" parameters (obligatory) and switches (optional) together. I really can't get it :( Could you give me some hints please.