{"id":22064531,"url":"https://github.com/josef-friedrich/shell-scripts","last_synced_at":"2025-10-04T23:29:15.316Z","repository":{"id":46987939,"uuid":"67670200","full_name":"Josef-Friedrich/shell-scripts","owner":"Josef-Friedrich","description":"A collection of shell scripts.","archived":false,"fork":false,"pushed_at":"2024-02-03T21:34:46.000Z","size":477,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-13T01:06:36.349Z","etag":null,"topics":["scripts-collection","shell"],"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/Josef-Friedrich.png","metadata":{"files":{"readme":"README-base.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,"zenodo":null}},"created_at":"2016-09-08T05:07:01.000Z","updated_at":"2023-09-08T17:14:32.000Z","dependencies_parsed_at":"2025-05-13T01:06:37.899Z","dependency_job_id":"2b139b9e-17e6-40fb-9e92-34c24a0ebca9","html_url":"https://github.com/Josef-Friedrich/shell-scripts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Josef-Friedrich/shell-scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Josef-Friedrich%2Fshell-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Josef-Friedrich%2Fshell-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Josef-Friedrich%2Fshell-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Josef-Friedrich%2Fshell-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Josef-Friedrich","download_url":"https://codeload.github.com/Josef-Friedrich/shell-scripts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Josef-Friedrich%2Fshell-scripts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278388130,"owners_count":25978491,"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-10-04T02:00:05.491Z","response_time":63,"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":["scripts-collection","shell"],"created_at":"2024-11-30T19:12:33.029Z","updated_at":"2025-10-04T23:29:15.301Z","avatar_url":"https://github.com/Josef-Friedrich.png","language":"Shell","readme":"[![Build Status](https://travis-ci.org/Josef-Friedrich/shell-scripts.svg?branch=master)](https://travis-ci.org/Josef-Friedrich/shell-scripts)\n\n# shell-scripts\n\nA collection of hopefully useful shell scripts\n\n## Coding style\n\n* Use tabs for indentation\n* Prefix functions with _\n* Variable names are UPPERCASE\n\nExample:\n\n```sh\nwhile getopts \":b:ht\" OPT; do\n\tcase $OPT in\n\t\tb)\n\t\t\tBODY=\"$OPTARG\"\n\t\t\t;;\n\t\th)\n\t\t\t_usage\n\t\t\t;;\n\t\tt)\n\t\t\tSUBJECT=\"Test mail \"\n\t\t\tBODY=\"Sent on $(date) to $MAILLOG_EMAIL.\"\n\t\t\techo \"Sending test mail to $MAILLOG_EMAIL.\"\n\t\t\t;;\n\t\t\\?)\n\t\t\techo \"Invalid option: -$OPTARG\" \u003e\u00262\n\t\t\t;;\n\tesac\ndone\n\nshift $((OPTIND-1))\n\nif [ -z \"$SUBJECT\" ]; then\n\tSUBJECT=\"$1\"\nfi\n\nFILE=\"$2\"\n\nif [ -z \"$SUBJECT\" ]; then\n\t_usage\nfi\n\nTMP_FILE=/tmp/maillog.sh_$(date +%s)\nif [ ! -f \"$FILE\" ] \u0026\u0026 [ -n \"$BODY\" ]; then\n\techo \"$BODY\" \u003e $TMP_FILE\n\tFILE=$TMP_FILE\nfi\n\nif [ ! -f \"$FILE\" ]; then\n\tFILE=$TMP_FILE\n\twhile read DATA; do\n\t\techo \"$DATA\" \u003e\u003e \"$FILE\"\n\t\techo \"$DATA\"\n\tdone\nfi\n\nmail -s \"$SUBJECT\" $MAILLOG_EMAIL \u003c \"$FILE\"\n```\n\n## Standard option `-h` or `--help`\n\n```sh\n_usage() {\n\techo \"Usage: $(basename \"$0\")\n\nOptions:\n\t-h, --help: Show this help message.\"\n}\n```\n\n```sh\nif [ \"$1\" = '-h' ] || [ \"$1\" = '--help' ] ; then\n\t_usage\n\texit 0\nfi\n```\n\n# Test\n\nRun test with this command: `make test`\n\n---\n\n# Help messages of all scripts\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosef-friedrich%2Fshell-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjosef-friedrich%2Fshell-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosef-friedrich%2Fshell-scripts/lists"}