Giter VIP home page Giter VIP logo

pkharsimran / dncheckbashscript Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 4 KB

This repository contains a Bash script designed to help users manage and inspect their Docker network environments. The script provides an easy-to-use command-line tool to list all Docker networks on a system and identify whether they are in use by any containers.

Shell 100.00%
automation bash cli container devops docker docker-networks docker-utilities json linux

dncheckbashscript's Introduction

DNCheckBashScript

This repository contains a Bash script designed to help users manage and inspect their Docker network environments. The script provides an easy-to-use command-line tool to list all Docker networks on a system and identify whether they are in use by any containers.

Features

  • Network Usage Detection: The script loops through all Docker networks and prints out whether each network is currently being used by running or stopped containers.
  • Default Network Skipping: It intelligently skips default Docker networks (bridge, host, none) to prevent unnecessary alerts, as these networks are typically used by Docker internally.
  • Container Listing: For networks that are in use, the script lists all associated container IDs and names, providing a detailed view of the network's utilization.
  • jq Auto-Installation: The script checks if jq (a lightweight and flexible command-line JSON processor) is installed on the system and attempts to install it if it's missing.

Prerequisites

  • Docker installed and running on your system
  • Bash shell environment
  • Sudo privileges (if jq is not installed and needs to be automatically installed by the script)

Usage

  1. Clone the repository to your local machine:

    git clone https://github.com/PKHarsimran/DNCheckBashScript.git
    
  2. Navigate to the cloned directory:

     cd DNCheckBashScript
    
  3. Make the script executable:

    chmod +x dncheck.sh
    
  4. Run the script:

    ./dncheck.sh
    

dncheckbashscript's People

Contributors

pkharsimran avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.