btc_horse/btc-UI/release/install.sh

32 lines
718 B
Bash
Executable File

#!/bin/bash
echo "🟢 Installing BTC POS Electron App..."
# 1. Extract the app to /opt
sudo mkdir -p /opt/btc-client
sudo tar -xzvf btc-pos-client.tar.gz -C /opt/btc-client --strip-components=1
# 2. Create systemd service
sudo tee /etc/systemd/system/btc-electron.service > /dev/null <<EOF
[Unit]
Description=BTC POS Electron App
After=network.target
[Service]
ExecStart=/opt/btc-client/btc-pos-client
Restart=always
Environment=DISPLAY=:0
User=pos
[Install]
WantedBy=default.target
EOF
# 3. Enable and start the service
sudo systemctl daemon-reexec
sudo systemctl daemon-reload
sudo systemctl enable btc-electron.service
sudo systemctl start btc-electron.service
echo "✅ BTC POS App installed and running!"