fn_check_ip 368 B

123456789101112131415
  1. #!/bin/bash
  2. # LGSM fn_check_ip function
  3. # Author: Daniel Gibbs
  4. # Website: http://danielgibbs.co.uk
  5. # Version: 210115
  6. # Description: Automatically identifies the server interface IP.
  7. # If multiple interfaces are detected the user will need to manualy set using ip="0.0.0.0".
  8. getip=$(hostname -I)
  9. if [ "${ip}" == "0.0.0.0" ]||[ "${ip}" == "" ]; then
  10. ip=${getip}
  11. fi