{"id":17423013,"url":"https://github.com/step-/shnetlib","last_synced_at":"2025-08-02T20:34:31.089Z","repository":{"id":145039965,"uuid":"100030296","full_name":"step-/shnetlib","owner":"step-","description":"A Linux shell library to retrieve basic network interface information.","archived":false,"fork":false,"pushed_at":"2019-11-04T17:54:39.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T23:18:14.397Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/step-.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-08-11T12:42:10.000Z","updated_at":"2019-11-04T17:51:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"e4b62972-e820-4dfc-ada7-3286a54945ae","html_url":"https://github.com/step-/shnetlib","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/step-/shnetlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/step-%2Fshnetlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/step-%2Fshnetlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/step-%2Fshnetlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/step-%2Fshnetlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/step-","download_url":"https://codeload.github.com/step-/shnetlib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/step-%2Fshnetlib/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268448362,"owners_count":24252019,"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-02T02:00:12.353Z","response_time":74,"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":[],"created_at":"2024-10-17T04:08:11.762Z","updated_at":"2025-08-02T20:34:31.065Z","avatar_url":"https://github.com/step-.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shnetlib\n\nLinux shell library to retrieve basic network interface information.\n\n## News\n\n**04-Nov-2019 Release 1.2.1**\n * Hide harmless error message.\n\n**10-Dec-2017 Release 1.2.0**\n * Add `IFACE_carrier` 'NA' '0' '1'.\n * Add `IFACE_opermode` 'NA' 'up' 'down' 'dormant' 'unknown'.\n\n## Scope\n\nShnetlib aims at retrieving network interface information that can be used to\nconfigure wired and wireless network interfaces from Linux shell scripts\nwithout bashisms. Shnetlib doesn't depend on external network commands. Its\ndesign focus is speed and a consistent API. It doesn't try to be comprehensive\nin the information it can retrieve but it is reasonably complete for most basic\nconfiguration tasks. A shell programmer should be able to extend its source\ncode easily as needed.\n\n### Examples\n\nThe project includes script file `demo.sh`.\n\nOther projects that use `shnetlib`:\n\n* [fatdog-wireless-antenna](https://github.com/step-/scripts-to-go/) is a simple\n  wireless radio antenna manager GUI.\n\n## Requirements and Installing\n\n* The `/sys` file system branch is required. All interface properties are\n  extracted from special files under `/sys`.\n* A bourne-like shell.  Shnetlib has been tested with ash, bash and dash.\n* Detailed information mode (optional) needs the `readlink` command.\n\nInstall by copying `usr/sbin/shnetlib.sh` to `/usr/sbin/shnetlib.sh`.\n\n## Using shnetlib in Your Script\n\n* Source the library `. /usr/sbin/shnetlib.sh`.\n* If you need detailed information mode set variable `SHNETLIB_MODE=detailed`.\n* Call `enum_interfaces` to fetch interface lists into library global\n   variables `IFACE_*`.\n* Call `get_iface_wired`, `get_iface_wireless`, `get_iface_other`, and\n   `get_iface_by_bus` to fetch interface specific information.\n\nAPI definition is provided as comment lines in file `usr/sbin/shnetlib.sh`.\nFile `demo.sh` exercises the entire API.\n\n## Change Log\n\nSee [release announcements](https://github.com/step-/shnetlib/releases)\nand - for fine-grained information -\n[commit history](https://github.com/step-/shnetlib/commits/master).\n\n## Old News\n\n_20-Aug-2017 Release 1.1.0_\n * Handle wireless kernel modules that don't support phy80211 and rfkill.\n * API: Add value 'NA' for elements of `IFACE_wireless_phy` and\n   `IFACE_wireless_rfkill_index`.\n\n_10-Aug-2017 Release 1.0.0_\n * First release.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstep-%2Fshnetlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstep-%2Fshnetlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstep-%2Fshnetlib/lists"}