remove disable script protection
This commit is contained in:
@@ -9,7 +9,7 @@ Files in this folder are treated as protected example scripts by the API:
|
||||
Protected behavior:
|
||||
|
||||
- scripts are synced from this folder into `/srv/fw-scripts` on backend startup
|
||||
- scripts in this folder cannot be overwritten, disabled, or deleted via the API
|
||||
- scripts in this folder cannot be overwritten, edited, or deleted via the API
|
||||
- scripts with a deploy config containing `qnum` are auto-started as systemd services
|
||||
|
||||
Example deploy file:
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"qnum": 1,
|
||||
"enable_at_boot": true
|
||||
}
|
||||
@@ -926,8 +926,6 @@ def enable_script(name: str, req: EnableRequest) -> OperationResult:
|
||||
except ValueError as e:
|
||||
raise HTTPException(status_code=400, detail=str(e))
|
||||
|
||||
assert_not_example_script(name, "manually enabled")
|
||||
|
||||
script_path = script_path_for(name)
|
||||
if not os.path.exists(script_path):
|
||||
raise HTTPException(status_code=404, detail="script not found")
|
||||
@@ -968,8 +966,6 @@ def disable_script(name: str, qnum: int) -> OperationResult:
|
||||
validate_name(name)
|
||||
except ValueError as e:
|
||||
raise HTTPException(status_code=400, detail=str(e))
|
||||
|
||||
assert_not_example_script(name, "disabled")
|
||||
service_name = make_service_name(name, qnum)
|
||||
# attempt stop + remove via systemctl-based remove_unit
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user