{"id":30651267,"url":"https://github.com/samuobe/shutdowncontrol","last_synced_at":"2025-08-31T06:13:40.762Z","repository":{"id":289492068,"uuid":"971430995","full_name":"Samuobe/shutdowncontrol","owner":"Samuobe","description":"Small program that allows a script to be prevented from continuing if there are blockages, example prevents the computer from shutting down if some programs are running","archived":false,"fork":false,"pushed_at":"2025-05-10T12:52:33.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-12T13:54:46.353Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Samuobe.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}},"created_at":"2025-04-23T14:07:17.000Z","updated_at":"2025-05-10T12:52:36.000Z","dependencies_parsed_at":"2025-08-12T13:54:48.705Z","dependency_job_id":"e15386b8-179b-4d9e-b3fc-fd65dcc8ca1c","html_url":"https://github.com/Samuobe/shutdowncontrol","commit_stats":null,"previous_names":["ilnonop/shutdowncontrol","samuobe/shutdowncontrol"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Samuobe/shutdowncontrol","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samuobe%2Fshutdowncontrol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samuobe%2Fshutdowncontrol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samuobe%2Fshutdowncontrol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samuobe%2Fshutdowncontrol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Samuobe","download_url":"https://codeload.github.com/Samuobe/shutdowncontrol/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samuobe%2Fshutdowncontrol/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272944761,"owners_count":25019625,"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-31T02:00:09.071Z","response_time":79,"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":"2025-08-31T06:13:00.504Z","updated_at":"2025-08-31T06:13:40.741Z","avatar_url":"https://github.com/Samuobe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ShutdownControl\nThis is a small CLI program that allows a script to be prevented from continuing if there are blockages, example prevents the computer from shutting down if some programs are running.\n\n## Features\n- Blocking by curl request\n- Unlocking by curl request\n- Supports multiple blocks simultaneously\n- Support for password verification to avoid unwanted locks or unlocks\n\n## Installation\nFor a quick installation just use the script given, use this command to download and run it, or download it from the repository\n\n```bash\nwget https://raw.githubusercontent.com/IlNonoP/shutdowncontrol/main/install.sh \u0026\u0026 sudo bash install.sh\n```\n  \n\n## Uninstallation\nFor a quick uninstallation just use the script given, use this command to download and run it, or download it from the repository\n```bash\nwget https://raw.githubusercontent.com/IlNonoP/shutdowncontrol/main/uninstall.sh \u0026\u0026 sudo bash uninstall.sh\n```\n\n## Usage\n### Start server\nUse is simple, once the program is installed you can start the server to receive lock and unlock requests. Use\n```bash\nshutdowncontrol start\n```\nto start it up. To choose a port other than the default (5000) you can specify it after the start command as in this example where 3004 is used\n\n```bash\nshutdowncontrol start 3004\n```\nIf you want to set a password to send lock or unlock requests add ```p=[password]```, in this example pippo will be used as the password\n\n```bash\nshutdowncontrol start p=pippo\n```\n\n\n### Send request\nCurl can be used to send lock and unlock requests.\n\nTo send blocking requests, it is necessary to use\n```bash\ncurl -d \"action=[lock/unlock]\" -d \"data=[id]\" -d \"password=[password]\" http(s)://[address]:[port]/     \n```\nThe varible data in this command are:\n- [lock/unlock] = Based on whether you want to send a lock (lock) or unlock (unlock) request\n- [id] = Chosen by the user, it is used to identify the blocking request and remove the specific one\n- [address] = Server address *\n- [port] = Server port *\n- [password] = Optional, but increases security. Note that it is necessary to write the password attached to the equal and the p. In case there is no password you can directly remove this part ```-d ”password=[password]“```\n\n*In case you do not know where to find this data, it is shown when the server starts up\n\n### Check whether it is possible to turn off\nLet's get to the juicy part of the talk. Let's say we have a script launched at system startup that shuts down our computer after an hour. We will have a script like this:\n```bash\n#!/bin/bash\n\nsleep 3600    #Wait one hour\npoweroff      #Turn off the computer\n```\n Now let's say that sometimes we want something to end before we turn everything off, but this thing takes more than an hour. We can integrate shutdowncontrol into our script with a simple command\n```bash\n#!/bin/bash\n\nsleep 3600    #Wait one hour\nshutdowncontrol watch    #Verify if he can turn off the computer\npoweroff      #Turn off the computer\n```\nThis command will check whether any locks have been set, that is, it will check whether any lock requests have been received. If there are not it will continue program execution, i.e. it will shut down the computer. Otherwise, if there are locks, it will wait for them to be removed before continuing the program.\n\n## Conclusion\nI hope the guide is clear, if you have any doubts or questions or find BUGs please feel free to mark them!!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuobe%2Fshutdowncontrol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamuobe%2Fshutdowncontrol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuobe%2Fshutdowncontrol/lists"}