mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-05-04 20:43:03 +02:00
30 lines
980 B
Plaintext
30 lines
980 B
Plaintext
pre_install() {
|
|
getent group remoteterm > /dev/null || groupadd -r remoteterm
|
|
getent passwd remoteterm > /dev/null || \
|
|
useradd -r -g remoteterm -d /var/lib/remoteterm-meshcore -s /sbin/nologin \
|
|
-c "RemoteTerm for MeshCore" remoteterm
|
|
}
|
|
|
|
pre_upgrade() {
|
|
pre_install
|
|
}
|
|
|
|
post_install() {
|
|
echo "==> Set your radio connection (serial, TCP, or BLE) in"
|
|
echo "==> /etc/remoteterm-meshcore/remoteterm.env"
|
|
echo "==> Start the service with: systemctl enable --now remoteterm-meshcore"
|
|
echo "==> The web UI will be at http://localhost:8000"
|
|
}
|
|
|
|
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
|
|
if systemctl is-active --quiet remoteterm-meshcore; then
|
|
systemctl restart remoteterm-meshcore
|
|
fi
|
|
fi
|
|
}
|