-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
26 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# SPDX-FileCopyrightText: © 2024 Jip-Hop and the Jailmakers <https://github.com/Jip-Hop/jailmaker> | ||
# | ||
# SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
|
||
import subprocess | ||
import time | ||
|
||
from actions.start import start_jail | ||
from actions.stop import stop_jail | ||
from utils.console import eprint | ||
|
||
|
||
def restart_jail(jail_name): | ||
""" | ||
Restart jail with given name. | ||
""" | ||
|
||
returncode = stop_jail(jail_name) | ||
if returncode != 0: | ||
eprint("Abort restart.") | ||
return returncode | ||
|
||
return start_jail(jail_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters