Add status page quick actions
Co-authored-by: Copilot <[email protected]>
This commit is contained in:
@@ -7,6 +7,7 @@ set -euo pipefail
|
||||
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
SERVICE_FILE="$REPO_DIR/deploy/yaris-obd.service"
|
||||
SERVICE_NAME="yaris-obd.service"
|
||||
STATUS_SUDOERS_FILE="$REPO_DIR/deploy/yaris-status-actions.sudoers"
|
||||
|
||||
if [ ! -d "$REPO_DIR/venv" ]; then
|
||||
echo "No venv found at $REPO_DIR/venv - creating one and installing requirements..."
|
||||
@@ -16,6 +17,8 @@ if [ ! -d "$REPO_DIR/venv" ]; then
|
||||
fi
|
||||
|
||||
sudo cp "$SERVICE_FILE" "/etc/systemd/system/$SERVICE_NAME"
|
||||
sudo install -m 440 "$STATUS_SUDOERS_FILE" /etc/sudoers.d/yaris-status-actions
|
||||
sudo visudo -cf /etc/sudoers.d/yaris-status-actions
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable "$SERVICE_NAME"
|
||||
sudo systemctl restart "$SERVICE_NAME"
|
||||
|
||||
@@ -235,6 +235,10 @@ cd /home/yaris/app/yaris-obd
|
||||
git pull --ff-only
|
||||
bash deploy/install_service.sh
|
||||
sudo systemctl restart yaris-obd.service
|
||||
|
||||
# Status page quick actions (restart app service) rely on the sudoers file
|
||||
# installed by install_service.sh. Re-run it after pulling if that action says
|
||||
# permission is not installed yet.
|
||||
```
|
||||
|
||||
If deploy files changed, rerun the corresponding installer script(s) (`install_netwatch.sh`, `install_port_redirect.sh`, etc.).
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
yaris ALL=(root) NOPASSWD: /usr/bin/systemctl restart --no-block yaris-obd.service
|
||||
Reference in New Issue
Block a user