{"id":31650515,"url":"https://github.com/octoleo/octodinator","last_synced_at":"2026-04-15T20:03:34.247Z","repository":{"id":316098017,"uuid":"1061954387","full_name":"octoleo/octodinator","owner":"octoleo","description":"mirror of https://git.vdm.dev/octoleo/octoshoom","archived":false,"fork":false,"pushed_at":"2025-09-22T16:59:50.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-07T08:45:33.333Z","etag":null,"topics":["bash","octoleo","shell"],"latest_commit_sha":null,"homepage":"https://git.vdm.dev/octoleo/octodinator","language":"Shell","has_issues":false,"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/octoleo.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-22T15:55:00.000Z","updated_at":"2025-09-23T12:56:03.000Z","dependencies_parsed_at":"2025-09-22T18:42:57.316Z","dependency_job_id":null,"html_url":"https://github.com/octoleo/octodinator","commit_stats":null,"previous_names":["octoleo/octodinator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/octoleo/octodinator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octoleo%2Foctodinator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octoleo%2Foctodinator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octoleo%2Foctodinator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octoleo%2Foctodinator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/octoleo","download_url":"https://codeload.github.com/octoleo/octodinator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octoleo%2Foctodinator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31857625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","octoleo","shell"],"created_at":"2025-10-07T08:30:09.318Z","updated_at":"2026-04-15T20:03:34.238Z","avatar_url":"https://github.com/octoleo.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch2\u003e\u003cimg align=\"middle\" src=\"https://raw.githubusercontent.com/odb/official-bash-logo/master/assets/Logos/Icons/PNG/64x64.png\" \u003e\nOctodinator - Coordinated Init \u0026 Cleanup for Multiple Programs.\n\u003c/h2\u003e\n\nWritten by Llewellyn van der Merwe (@llewellynvdm)\n\nA simple CLI utility to **coordinate one-time initialization and cleanup** across multiple programs or scripts.\nRuns a specified *init* command when the **first program** starts, and a *cleanup* command when the **last program** stops.\nUses a shared lock directory to track active programs and prevent duplicate init/cleanup runs.\nSupports `.json` configuration files and CLI overrides for full flexibility.\n\nLinted by [#ShellCheck](https://github.com/koalaman/shellcheck)\n\n---\n\n## Install\n\n```shell\n$ sudo curl -L \"https://raw.githubusercontent.com/octoleo/octodinator/refs/heads/master/src/octodinator\" -o /usr/local/bin/octodinator\n$ sudo chmod +x /usr/local/bin/octodinator\n```\n\n* Global **config** file can be set at: `/home/$USER/.config/octodinator/config.json`\n* OR use the `--conf=/path/to/config.json` flag to load a project-specific configuration.\n\n**Configuration File (config.json):**\n\n```json\n{\n  \"lock_dir\": \"/tmp/octodinator\",\n  \"init_command\": \"octoflare --domain=example.com --disable-attack-mode\",\n  \"cleanup_command\": \"octoflare --domain=example.com --enable-attack-mode\"\n}\n```\n\n* `lock_dir`: Required. Directory used to store `.lock` files for running programs.\n* `init_command`: Required. Command to run when the first program starts.\n* `cleanup_command`: Required. Command to run when the last program stops.\n\n---\n\n## Usage\n\n\u003e To see the help menu\n\n```shell\n$ octodinator -h\n```\n\n---\n\n\u003e To update\n\n```shell\n$ octodinator --update\n```\n\n---\n\n\u003e To uninstall\n\n```shell\n$ octodinator --uninstall\n```\n\n---\n\n### Help Menu (Octodinator)\n\n```txt\nUsage: octodinator [options] start|stop \u003cid\u003e\n\n        Options\n        ======================================================\n        -ld | --lock-dir=\u003cpath\u003e   Directory where lock files are stored\n        -i  | --init=\u003ccommand\u003e    Command to run on first program start\n        -c  | --cleanup=\u003ccommand\u003e Command to run on last program stop\n        --conf=\u003cpath\u003e             JSON config file with {lock_dir, init_command, cleanup_command}\n        -q  | --quiet             Suppress all output\n        --update                  Update this script to latest version\n        --uninstall               Uninstall this script\n        -h  | --help              Show this help menu\n        ======================================================\n                        Octodinator v1.0.0\n        ======================================================\n```\n\n---\n\n### Example\n\nStart a program and trigger the init command if this is the first active one:\n\n```shell\n$ octodinator --lock-dir=\"/tmp/octodinator\" \\\n              --init=\"octoflare --domain=example.com --disable-attack-mode\" \\\n              --cleanup=\"octoflare --domain=example.com --enable-attack-mode\" \\\n              start program1\n```\n\nStop a program and trigger cleanup only if this was the last active one:\n\n```shell\n$ octodinator --lock-dir=\"/tmp/octodinator\" stop program1\n```\n\nUsing a config file:\n\n```shell\n$ octodinator --conf=/home/$USER/.config/octodinator/config.json start program2\n$ octodinator --conf=/home/$USER/.config/octodinator/config.json stop program2\n```\n\n---\n\n### Example Integration\n\nIn a script (`programA.sh`):\n\n```bash\n#!/bin/bash\noctodinator start programA\n\n# Program logic here\nsleep 5\n\noctodinator stop programA\n```\n\nWhen running multiple scripts with the same `--lock-dir`,\ninit runs **once at the first start**, cleanup runs **once at the very end**.\n\n---\n\n### Free Software License\n\n```txt\n@copyright  Copyright (C) 2025 Llewellyn van der Merwe. All rights reserved.\n@license    GNU General Public License version 2; see LICENSE.txt\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctoleo%2Foctodinator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctoleo%2Foctodinator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctoleo%2Foctodinator/lists"}