{"id":24996774,"url":"https://github.com/david-moreno/bash-libnetwork","last_synced_at":"2025-08-29T09:23:54.601Z","repository":{"id":149829383,"uuid":"96249832","full_name":"david-moreno/bash-libnetwork","owner":"david-moreno","description":"A Bash library with basic networking utilities","archived":false,"fork":false,"pushed_at":"2017-07-04T21:21:42.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T15:46:26.564Z","etag":null,"topics":["bash","library","network","networking"],"latest_commit_sha":null,"homepage":null,"language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/david-moreno.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-04T20:05:43.000Z","updated_at":"2017-07-04T21:23:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"b345eb1f-d4b3-46da-9615-9cc9bb2375f0","html_url":"https://github.com/david-moreno/bash-libnetwork","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/david-moreno/bash-libnetwork","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/david-moreno%2Fbash-libnetwork","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/david-moreno%2Fbash-libnetwork/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/david-moreno%2Fbash-libnetwork/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/david-moreno%2Fbash-libnetwork/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/david-moreno","download_url":"https://codeload.github.com/david-moreno/bash-libnetwork/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/david-moreno%2Fbash-libnetwork/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272659284,"owners_count":24971607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","library","network","networking"],"created_at":"2025-02-04T16:32:31.211Z","updated_at":"2025-08-29T09:23:54.543Z","avatar_url":"https://github.com/david-moreno.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bash-libnetwork\n\nA Bash library with basic networking utilities\n\nInstall\n-------\n\nYou can clone this repository or download it as a zip file. To clone:\n\n    $ git clone https://github.com/david-moreno/bash-libnetwork.git\n    $ cd bash-libnetwork\n    $ sudo make install\n\nUninstall\n---------\n\nUsing the cloned/unzipped directory:\n\n    $ cd bash-libnetwork\n    $ sudo make uninstall\n\nUsage\n-----\n\n#### net_available_ifaces\nReturns the available network interfaces\n\n#### net_iface_isavailable *iface*\nChecks if *iface* exists\n\n#### net_get_iface_ip *iface*\nReturns the IP address of *iface*\n\n#### net_get_iface_mac *iface*\nReturns the MAC address of *iface*\n\n#### net_get_iface_mtu *iface*\nReturns the MTU value of *iface*\n\n#### net_iface_up *iface*\nChecks if *iface* is UP\n\n#### net_get_iface\nReturns the current active network interface\n\n#### net_get_gateway\nReturns the current gateway IP address\n\n#### net_connected_inet\nChecks if the host is connected to internet\n\n#### net_iface_iswireless *iface*\nChecks if *iface* is a wireless device\n\nExample\n-------\n\n```bash\n#!/bin/bash\n\n#Includes the library into the script\nsource \"/usr/lib/bash/libnetwork\"\n\necho \"Available network interfaces:\"\nfor i in `net_available_ifaces`; do\n\techo \"- $i\"\ndone\n\nif (( ! `net_connected_inet` )); then\n\techo \"No Internet connection\"\n\texit\nfi\n\niface=`net_get_iface`\nif [ -z \"$iface\" ]; then\n\techo \"No active network interfaces founded\"\n\texit\nfi\n\necho -e \"\\nThe current active network interface is: $iface\"\nif (( `net_iface_iswireless $iface` )); then\n\techo -e \"\\t$iface is wireless\"\nfi\necho -e \"\\tIP: \" `net_get_iface_ip $iface`\necho -e \"\\tMAC: \" `net_get_iface_mac $iface`\necho -e \"\\tMTU: \" `net_get_iface_mtu $iface`\n\necho -e \"\\nGateway: \" `net_get_gateway`\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavid-moreno%2Fbash-libnetwork","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavid-moreno%2Fbash-libnetwork","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavid-moreno%2Fbash-libnetwork/lists"}