os-detect

A script for working out what OS you are running on as some scripts need to be OS aware.

https://github.com/developerstoolbox/os-detect

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.9%) to scientific vocabulary

Keywords

bash os-detect wolfsoftware
Last synced: 4 months ago · JSON representation ·

Repository

A script for working out what OS you are running on as some scripts need to be OS aware.

Basic Info
  • Host: GitHub
  • Owner: DevelopersToolbox
  • License: mit
  • Language: Shell
  • Default Branch: master
  • Homepage:
  • Size: 168 KB
Statistics
  • Stars: 4
  • Watchers: 0
  • Forks: 0
  • Open Issues: 3
  • Releases: 1
Topics
bash os-detect wolfsoftware
Created almost 5 years ago · Last pushed 4 months ago
Metadata Files
Readme Contributing Funding License Code of conduct Citation Codeowners Security

README.md

DevelopersToolbox logo
Github Build Status License Created
Release Released Commits since release

Overview

A script for working out what OS you are running on as some scripts need to be OS aware.

Table of Contents

  1. Usage
  2. Functions
  3. Environment Variables
  4. Example Output

Usage

Simple Usage

```shell source os-detect.sh

fullosdetect

echo "OS: $OSDOS" echo "DISTRIBUTION: $OSDDISTRIBUTION" echo "NAME: $OSDNAME" echo "CODENAME: $OSDCODENAME" echo "RELEASE: $OSDRELEASE" echo "VERSION: $OSDVERSION" echo "PLATFORMVERSION: $OSDPLATFORMVERSION" echo "BASEDON: $OSDBASEDON" echo "KERNEL: $OSDKERNEL" echo "ARCH: $OSDARCH" ```

Custom usage

```shell source os-detect.sh

detectdistribution detectversion

echo "DISTRIBUTION: $OSDDISTRIBUTION" echo "VERSION: $OSDVERSION" ```

Functions

The following functions exist:

  • detect_os
  • detect_kernel
  • detect_architecture
  • detect_distribution
  • detect_name
  • detect_version
  • detectplatformversion
  • detect_release
  • detect_codename
  • detect_basedon
  • fullosdetect

Environment Variables

The following environment variables are set:

  • OSD_OS
  • OSD_DISTRIBUTION
  • OSD_NAME
  • OSD_CODENAME
  • OSD_RELEASE
  • OSD_VERSION
  • OSDPLATFORMVERSION
  • OSD_BASEDON
  • OSD_KERNEL
  • OSD_ARCH

Examples of usage by OS

Alma Linux

shell OS: Linux DISTRIBUTION: almalinux NAME: AlmaLinux CODENAME: Arctic Sphynx RELEASE: 8.5 VERSION: 8.5 PLATFORM VERSION: el-8 BASEDON: rhel centos fedora KERNEL: 5.10.76-linuxkit ARCH: x86_64

Alpine

shell OS: Linux DISTRIBUTION: alpine NAME: Alpine Linux CODENAME: unknown RELEASE: unknown VERSION: 3.14.2 PLATFORM VERSION: unknown BASEDON: unknown KERNEL: 5.10.76-linuxkit ARCH: x86_64

Amazon Linux

shell OS: Linux DISTRIBUTION: amzn NAME: Amazon Linux CODENAME: unknown RELEASE: 2 VERSION: 2 PLATFORM VERSION: unknown BASEDON: centos rhel fedora KERNEL: 5.10.76-linuxkit ARCH: x86_64

Arch Linux

shell OS: Linux DISTRIBUTION: arch NAME: Arch Linux CODENAME: unknown RELEASE: unknown VERSION: unknown PLATFORM VERSION: unknown BASEDON: unknown KERNEL: 5.10.76-linuxkit ARCH: x86_64

Centos

shell OS: Linux DISTRIBUTION: centos NAME: CentOS Linux CODENAME: Core RELEASE: 7.9.2009 VERSION: 7 PLATFORM VERSION: unknown BASEDON: rhel fedora KERNEL: 5.10.76-linuxkit ARCH: x86_64

Debian

shell OS: Linux DISTRIBUTION: debian NAME: Debian GNU/Linux CODENAME: bullseye RELEASE: 11.1 VERSION: 11 PLATFORM VERSION: unknown BASEDON: debian KERNEL: 5.10.76-linuxkit ARCH: x86_64

Mac OS

shell OS: Mac OS DISTRIBUTION: unknown NAME: macOS CODENAME: unknown RELEASE: 12.2.1 VERSION: unknown PLATFORM VERSION: unknown BASEDON: unknown KERNEL: 21.3.0 ARCH: x86_64

Oracle Linux

shell OS: Linux DISTRIBUTION: ol NAME: Oracle Linux Server CODENAME: Ootpa RELEASE: 8.5 VERSION: 8.5 PLATFORM VERSION: el-8 BASEDON: fedora KERNEL: 5.10.76-linuxkit ARCH: x86_64

Photon Linux

shell OS: Linux DISTRIBUTION: photon NAME: VMware Photon OS CODENAME: unknown RELEASE: 4.0 VERSION: 4.0 PLATFORM VERSION: unknown BASEDON: unknown KERNEL: 5.10.76-linuxkit ARCH: x86_64

Rocky Linux

shell OS: Linux DISTRIBUTION: rocky NAME: Rocky Linux CODENAME: Green Obsidian RELEASE: 8.5 VERSION: 8.5 PLATFORM VERSION: el-8 BASEDON: rhel centos fedora KERNEL: 5.10.76-linuxkit ARCH: x86_64

Scientific Linux

shell OS: Linux DISTRIBUTION: scientific NAME: Scientific Linux CODENAME: Nitrogen RELEASE: 7.9 VERSION: 7.9 PLATFORM VERSION: unknown BASEDON: rhel centos fedora KERNEL: 5.10.76-linuxkit ARCH: x86_64

Ubuntu

shell OS: Linux DISTRIBUTION: ubuntu NAME: Ubuntu CODENAME: focal RELEASE: 20.04 VERSION: 20.04 PLATFORM VERSION: unknown BASEDON: debian KERNEL: 5.10.76-linuxkit ARCH: x86_64


Owner

  • Name: Developers Toolbox
  • Login: DevelopersToolbox
  • Kind: organization
  • Email: github@wolfsoftware.com
  • Location: United Kingdom

A selection of tools to help developers. Created by Wolf Software.

Citation (CITATION.cff)

cff-version: 1.2.0
message: If you use this software, please cite it using these metadata.
title: OS Detection
abstract: A script for working out what OS you are running on as some scripts need to be OS aware.
type: software
version: 0.1.0
date-released: 2024-06-04
repository-code: https://github.com/DevelopersToolbox/os-detect
keywords:
  - "Wolf Software"
  - "Software"
license: MIT
authors:
  - family-names: "Wolf"
    orcid: "https://orcid.org/0009-0007-0983-2072"

GitHub Events

Total
  • Watch event: 1
  • Delete event: 61
  • Issue comment event: 127
  • Push event: 117
  • Pull request review event: 104
  • Pull request event: 121
  • Create event: 64
Last Year
  • Watch event: 1
  • Delete event: 61
  • Issue comment event: 127
  • Push event: 117
  • Pull request review event: 104
  • Pull request event: 121
  • Create event: 64

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 1
  • Total pull requests: 85
  • Average time to close issues: about 1 month
  • Average time to close pull requests: about 5 hours
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 1.0
  • Average comments per pull request: 1.62
  • Merged pull requests: 76
  • Bot issues: 1
  • Bot pull requests: 85
Past Year
  • Issues: 1
  • Pull requests: 66
  • Average time to close issues: about 1 month
  • Average time to close pull requests: about 6 hours
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 1.0
  • Average comments per pull request: 1.56
  • Merged pull requests: 57
  • Bot issues: 1
  • Bot pull requests: 66
Top Authors
Issue Authors
  • dependabot[bot] (1)
Pull Request Authors
  • dependabot[bot] (132)
Top Labels
Issue Labels
dependabot: dependencies (1) dependabot: ecosystem : github actions (1) dependabot: auto approve (1) dependabot: auto merge (1)
Pull Request Labels
dependabot: dependencies (132) dependabot: ecosystem : github actions (132) dependabot: auto approve (123) dependabot: auto merge (123) dependabot: manual merge (1)

Dependencies

.github/workflows/cicd.yml actions
  • actions/checkout a5ac7e51b41094c92402da3b24376905380afc29 composite
.github/workflows/citation-validation.yml actions
  • ActionsToolbox/get-language-versions-action 446919617fd774095b5dd3ed71c39dd3fd0d8f4f composite
  • actions/checkout a5ac7e51b41094c92402da3b24376905380afc29 composite
  • citation-file-format/cffconvert-github-action 4cf11baa70a673bfdf9dad0acc7ee33b3f4b6084 composite
  • ruby/setup-ruby d5fb7a202fc07872cb44f00ba8e6197b70cb0c55 composite
.github/workflows/delete-old-workflow-runs.yml actions
  • Gamesight/slack-workflow-status 68bf00d0dbdbcb206c278399aa1ef6c14f74347a composite
  • Mattraks/delete-workflow-runs 39f0bbed25d76b34de5594dceab824811479e5de composite
.github/workflows/dependabot.yml actions
  • dependabot/fetch-metadata 5e5f99653a5b510e8555840e80cbf1514ad4af38 composite
.github/workflows/document-validation.yml actions
  • ActionsToolbox/get-language-versions-action 446919617fd774095b5dd3ed71c39dd3fd0d8f4f composite
  • actions/checkout a5ac7e51b41094c92402da3b24376905380afc29 composite
  • actions/setup-node 60edb5dd545a775178f52524783378180af0d1f8 composite
  • ruby/setup-ruby d5fb7a202fc07872cb44f00ba8e6197b70cb0c55 composite
.github/workflows/generate-release.yml actions
  • Bullrich/generate-release-changelog 6b60f004b4bf12ff271603dc32dbd261965ad2f2 composite
  • actions/checkout a5ac7e51b41094c92402da3b24376905380afc29 composite
  • softprops/action-gh-release 69320dbe05506a9a39fc8ae11030b214ec2d1f87 composite
.github/workflows/generate-test-release.yml actions
  • Bullrich/generate-release-changelog 6b60f004b4bf12ff271603dc32dbd261965ad2f2 composite
  • actions/checkout a5ac7e51b41094c92402da3b24376905380afc29 composite
  • softprops/action-gh-release 69320dbe05506a9a39fc8ae11030b214ec2d1f87 composite
.github/workflows/greetings.yml actions
  • actions/first-interaction 34f15e814fe48ac9312ccf29db4e74fa767cbab7 composite
.github/workflows/purge-deprecated-workflow-runs.yml actions
  • Gamesight/slack-workflow-status 68bf00d0dbdbcb206c278399aa1ef6c14f74347a composite
  • otto-de/purge-deprecated-workflow-runs 31a4e821d43e9a354cbd65845922c76e4b4b3633 composite
.github/workflows/repository-validation.yml actions
  • ActionsToolbox/get-language-versions-action 446919617fd774095b5dd3ed71c39dd3fd0d8f4f composite
  • actions/checkout a5ac7e51b41094c92402da3b24376905380afc29 composite
  • actions/setup-go cdcb36043654635271a94b9a6d1392de5bb323a7 composite
  • actions/setup-python 82c7e631bb3cdc910f68e0081d67478d79c6982d composite
.github/workflows/security-hardening.yml actions
  • actions/checkout a5ac7e51b41094c92402da3b24376905380afc29 composite
  • zgosalvez/github-actions-ensure-sha-pinned-actions 2f2ebc6d914ab515939dc13f570f91baeb2c194c composite
.github/workflows/stale.yml actions
  • Gamesight/slack-workflow-status 68bf00d0dbdbcb206c278399aa1ef6c14f74347a composite
  • actions/stale 28ca1036281a5e5922ead5184a1bbf96e5fc984e composite