convert service_controls.php system_controls.php

This commit is contained in:
frederik
2024-03-15 10:38:58 +01:00
parent 83f72c4991
commit a48bda055b
3 changed files with 12 additions and 15 deletions
+4 -4
View File
@@ -1,9 +1,9 @@
<?php
session_start();
$user = shell_exec("awk -F: '/1000/{print $1}' /etc/passwd");
$user = trim($user);
$home = shell_exec("awk -F: '/1000/{print $6}' /etc/passwd");
$home = trim($home);
require_once "scripts/common.php";
$user = get_user();
$home = get_home();
$fetch = shell_exec("sudo -u".$user." git -C ".$home."/BirdNET-Pi fetch 2>&1");
$str = trim(shell_exec("sudo -u".$user." git -C ".$home."/BirdNET-Pi status"));
if (preg_match("/behind '.*?' by (\d+) commit(s?)\b/", $str, $matches)) {