mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-05-01 02:53:00 +02:00
Be more defensive about systemd detection
This commit is contained in:
@@ -20,10 +20,12 @@ post_upgrade() {
|
||||
# Clean orphaned __pycache__ dirs left by the previous Python version
|
||||
find /opt/remoteterm-meshcore -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
|
||||
|
||||
if command -v systemctl &>/dev/null && systemctl --version &>/dev/null 2>&1; then
|
||||
systemctl daemon-reload
|
||||
# Skip systemd operations in chroots/containers where the binary may exist
|
||||
# but PID 1 is not systemd.
|
||||
if [ -d /run/systemd/system ] && command -v systemctl &>/dev/null; then
|
||||
systemctl daemon-reload || true
|
||||
if systemctl is-active --quiet remoteterm-meshcore; then
|
||||
systemctl restart remoteterm-meshcore
|
||||
systemctl restart remoteterm-meshcore || true
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user