You want to know how to use the
$IP from the command line as a parameter to another part of your script? This is a little like Bash 101 (Bash for Beginners), and it sounds like you could be recommended to spend some time going through a scripting tutorial.
However, to answer your question directly, each parameter is available as a numbered variable,
$2, and so on. So you can (re)use the first parameter like this:
If you're really keen, at the top of your script assign the parameters to variables and use those (it helps with documentation of the code):