mirror of
https://github.com/akuker/RASCSI.git
synced 2024-06-02 11:41:34 +00:00
37f1166fd8
* gitignore * New Web Interface Fixed spacing/tabs in easy install Added migration check Fix update web not actually updating Migrating from https://github.com/erichelgeson/RaSCSI-web * Allow user to select multiple types when creating images * Show all devices even if nothing is attached. * If attaching an iso to a cd device, dont detach, just insert * UI feedback and restart rascsi service * Check for any non-0 exit code for apache2 detection * Pretty/informative 502 * Add confirms to some actions. Works in netscape 4.7 * Fix order of params for create_new_image * Move non-route method to service * Add method for getting logs * Move settings to single file add ability to mock commands for local dev
21 lines
637 B
Python
21 lines
637 B
Python
import subprocess
|
|
|
|
|
|
def rascsi_service(action):
|
|
# start/stop/restart
|
|
return subprocess.run(["sudo", "/bin/systemctl", action, "rascsi.service"]).returncode == 0
|
|
|
|
|
|
def reboot_pi():
|
|
return subprocess.run(["sudo", "reboot"]).returncode == 0
|
|
|
|
|
|
def shutdown_pi():
|
|
return subprocess.run(["sudo", "shutdown", "-h", "now"]).returncode == 0
|
|
|
|
|
|
def running_version():
|
|
ra_web_version = subprocess.run(["git", "rev-parse", "HEAD"], capture_output=True).stdout.decode("utf-8").strip()
|
|
pi_version = subprocess.run(["uname", "-a"], capture_output=True).stdout.decode("utf-8").strip()
|
|
return ra_web_version + " " + pi_version
|