{"id":22316665,"url":"https://github.com/developerstoolbox/os-detect","last_synced_at":"2025-07-29T12:30:31.945Z","repository":{"id":114323631,"uuid":"339105136","full_name":"DevelopersToolbox/os-detect","owner":"DevelopersToolbox","description":"A script for working out what OS you are running on as some scripts need to be OS aware.","archived":false,"fork":false,"pushed_at":"2025-07-21T05:53:39.000Z","size":167,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-21T07:29:11.294Z","etag":null,"topics":["bash","os-detect","wolfsoftware"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DevelopersToolbox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["WolfSoftware","TGWolf"]}},"created_at":"2021-02-15T14:34:35.000Z","updated_at":"2025-07-21T05:52:48.000Z","dependencies_parsed_at":"2024-08-26T05:28:41.690Z","dependency_job_id":"399d622e-25f8-4c17-b3df-c15b77436ac3","html_url":"https://github.com/DevelopersToolbox/os-detect","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/DevelopersToolbox/os-detect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevelopersToolbox%2Fos-detect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevelopersToolbox%2Fos-detect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevelopersToolbox%2Fos-detect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevelopersToolbox%2Fos-detect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevelopersToolbox","download_url":"https://codeload.github.com/DevelopersToolbox/os-detect/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevelopersToolbox%2Fos-detect/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267686334,"owners_count":24127715,"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-07-29T02:00:12.549Z","response_time":2574,"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","os-detect","wolfsoftware"],"created_at":"2024-12-03T23:07:24.225Z","updated_at":"2025-07-29T12:30:31.670Z","avatar_url":"https://github.com/DevelopersToolbox.png","language":"Shell","readme":"\u003c!-- markdownlint-disable --\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/\"\u003e\n        \u003cimg src=\"https://cdn.wolfsoftware.com/assets/images/github/organisations/developerstoolbox/black-and-white-circle-256.png\" alt=\"DevelopersToolbox logo\" /\u003e\n    \u003c/a\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/os-detect/actions/workflows/cicd.yml\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/DevelopersToolbox/os-detect/cicd.yml?branch=master\u0026label=build%20status\u0026style=for-the-badge\" alt=\"Github Build Status\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/os-detect/blob/master/LICENSE.md\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/license/DevelopersToolbox/os-detect?color=blue\u0026label=License\u0026style=for-the-badge\" alt=\"License\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/os-detect\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/created-at/DevelopersToolbox/os-detect?color=blue\u0026label=Created\u0026style=for-the-badge\" alt=\"Created\"\u003e\n    \u003c/a\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/os-detect/releases/latest\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/v/release/DevelopersToolbox/os-detect?color=blue\u0026label=Latest%20Release\u0026style=for-the-badge\" alt=\"Release\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/os-detect/releases/latest\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/release-date/DevelopersToolbox/os-detect?color=blue\u0026label=Released\u0026style=for-the-badge\" alt=\"Released\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/os-detect/releases/latest\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/commits-since/DevelopersToolbox/os-detect/latest.svg?color=blue\u0026style=for-the-badge\" alt=\"Commits since release\"\u003e\n    \u003c/a\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/os-detect/blob/master/.github/CODE_OF_CONDUCT.md\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Code%20of%20Conduct-blue?style=for-the-badge\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/os-detect/blob/master/.github/CONTRIBUTING.md\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Contributing-blue?style=for-the-badge\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/os-detect/blob/master/.github/SECURITY.md\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Report%20Security%20Concern-blue?style=for-the-badge\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/DevelopersToolbox/os-detect/issues\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Get%20Support-blue?style=for-the-badge\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n## Overview\n\nA script for working out what OS you are running on as some scripts need to be OS aware.\n\n## Table of Contents\n1. [Usage](#usage)\n1. [Functions](#functions)\n1. [Environment Variables](#environment-variables)\n1. [Example Output](#example-output)\n\n\u003ca name=\"usage\"\u003e\u003c/a\u003e\n## Usage\n\n### Simple Usage\n\n```shell\nsource os-detect.sh\n\nfull_os_detect\n\necho \"OS: $OSD_OS\"\necho \"DISTRIBUTION: $OSD_DISTRIBUTION\"\necho \"NAME: $OSD_NAME\"\necho \"CODENAME: $OSD_CODENAME\"\necho \"RELEASE: $OSD_RELEASE\"\necho \"VERSION: $OSD_VERSION\"\necho \"PLATFORM_VERSION: $OSD_PLATFORM_VERSION\"\necho \"BASEDON: $OSD_BASEDON\"\necho \"KERNEL: $OSD_KERNEL\"\necho \"ARCH: $OSD_ARCH\"\n```\n\n### Custom usage\n\n```shell\nsource os-detect.sh\n\ndetect_distribution\ndetect_version\n\necho \"DISTRIBUTION: $OSD_DISTRIBUTION\"\necho \"VERSION: $OSD_VERSION\"\n```\n\n\u003ca name=\"functions\"\u003e\u003c/a\u003e\n## Functions\n\nThe following functions exist:\n\n* detect_os\n* detect_kernel\n* detect_architecture\n* detect_distribution\n* detect_name\n* detect_version\n* detect_platform_version\n* detect_release\n* detect_codename\n* detect_basedon\n* full_os_detect\n\n\u003ca name=\"environment-variables\"\u003e\u003c/a\u003e\n## Environment Variables\n\nThe following environment variables are set:\n\n* OSD_OS\n* OSD_DISTRIBUTION\n* OSD_NAME\n* OSD_CODENAME\n* OSD_RELEASE\n* OSD_VERSION\n* OSD_PLATFORM_VERSION\n* OSD_BASEDON\n* OSD_KERNEL\n* OSD_ARCH\n\n\u003ca name=\"example-output\"\u003e\u003c/a\u003e\n## Examples of usage by OS\n\n### Alma Linux\n\n```shell\nOS:               Linux\nDISTRIBUTION:     almalinux\nNAME:             AlmaLinux\nCODENAME:         Arctic Sphynx\nRELEASE:          8.5\nVERSION:          8.5\nPLATFORM VERSION: el-8\nBASEDON:          rhel centos fedora\nKERNEL:           5.10.76-linuxkit\nARCH:             x86_64\n```\n\n### Alpine\n\n```shell\nOS:               Linux\nDISTRIBUTION:     alpine\nNAME:             Alpine Linux\nCODENAME:         unknown\nRELEASE:          unknown\nVERSION:          3.14.2\nPLATFORM VERSION: unknown\nBASEDON:          unknown\nKERNEL:           5.10.76-linuxkit\nARCH:             x86_64\n```\n\n### Amazon Linux\n\n```shell\nOS:               Linux\nDISTRIBUTION:     amzn\nNAME:             Amazon Linux\nCODENAME:         unknown\nRELEASE:          2\nVERSION:          2\nPLATFORM VERSION: unknown\nBASEDON:          centos rhel fedora\nKERNEL:           5.10.76-linuxkit\nARCH:             x86_64\n```\n\n### Arch Linux\n\n```shell\nOS:               Linux\nDISTRIBUTION:     arch\nNAME:             Arch Linux\nCODENAME:         unknown\nRELEASE:          unknown\nVERSION:          unknown\nPLATFORM VERSION: unknown\nBASEDON:          unknown\nKERNEL:           5.10.76-linuxkit\nARCH:             x86_64\n```\n\n### Centos\n\n```shell\nOS:               Linux\nDISTRIBUTION:     centos\nNAME:             CentOS Linux\nCODENAME:         Core\nRELEASE:          7.9.2009\nVERSION:          7\nPLATFORM VERSION: unknown\nBASEDON:          rhel fedora\nKERNEL:           5.10.76-linuxkit\nARCH:             x86_64\n```\n\n### Debian\n\n```shell\nOS:               Linux\nDISTRIBUTION:     debian\nNAME:             Debian GNU/Linux\nCODENAME:         bullseye\nRELEASE:          11.1\nVERSION:          11\nPLATFORM VERSION: unknown\nBASEDON:          debian\nKERNEL:           5.10.76-linuxkit\nARCH:             x86_64\n```\n\n### Mac OS\n\n```shell\nOS:               Mac OS\nDISTRIBUTION:     unknown\nNAME:             macOS\nCODENAME:         unknown\nRELEASE:          12.2.1\nVERSION:          unknown\nPLATFORM VERSION: unknown\nBASEDON:          unknown\nKERNEL:           21.3.0\nARCH:             x86_64\n```\n\n### Oracle Linux\n\n```shell\nOS:               Linux\nDISTRIBUTION:     ol\nNAME:             Oracle Linux Server\nCODENAME:         Ootpa\nRELEASE:          8.5\nVERSION:          8.5\nPLATFORM VERSION: el-8\nBASEDON:          fedora\nKERNEL:           5.10.76-linuxkit\nARCH:             x86_64\n```\n\n### Photon Linux\n\n```shell\nOS:               Linux\nDISTRIBUTION:     photon\nNAME:             VMware Photon OS\nCODENAME:         unknown\nRELEASE:          4.0\nVERSION:          4.0\nPLATFORM VERSION: unknown\nBASEDON:          unknown\nKERNEL:           5.10.76-linuxkit\nARCH:             x86_64\n```\n\n### Rocky Linux\n\n```shell\nOS:               Linux\nDISTRIBUTION:     rocky\nNAME:             Rocky Linux\nCODENAME:         Green Obsidian\nRELEASE:          8.5\nVERSION:          8.5\nPLATFORM VERSION: el-8\nBASEDON:          rhel centos fedora\nKERNEL:           5.10.76-linuxkit\nARCH:             x86_64\n```\n\n### Scientific Linux\n\n```shell\nOS:               Linux\nDISTRIBUTION:     scientific\nNAME:             Scientific Linux\nCODENAME:         Nitrogen\nRELEASE:          7.9\nVERSION:          7.9\nPLATFORM VERSION: unknown\nBASEDON:          rhel centos fedora\nKERNEL:           5.10.76-linuxkit\nARCH:             x86_64\n```\n\n### Ubuntu\n\n```shell\nOS:               Linux\nDISTRIBUTION:     ubuntu\nNAME:             Ubuntu\nCODENAME:         focal\nRELEASE:          20.04\nVERSION:          20.04\nPLATFORM VERSION: unknown\nBASEDON:          debian\nKERNEL:           5.10.76-linuxkit\nARCH:             x86_64\n```\n\n\u003cbr /\u003e\n\u003cp align=\"right\"\u003e\u003ca href=\"https://wolfsoftware.com/\"\u003e\u003cimg src=\"https://img.shields.io/badge/Created%20by%20Wolf%20on%20behalf%20of%20Wolf%20Software-blue?style=for-the-badge\" /\u003e\u003c/a\u003e\u003c/p\u003e\n","funding_links":["https://github.com/sponsors/WolfSoftware","https://github.com/sponsors/TGWolf"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloperstoolbox%2Fos-detect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeveloperstoolbox%2Fos-detect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloperstoolbox%2Fos-detect/lists"}