Skip to content

Commit

Permalink
Update README, update install.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
subs1stem committed Aug 26, 2024
1 parent f109c96 commit 79bc11a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 23 deletions.
34 changes: 24 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
# wb-shtyl

Module for integrating Shtyl UPS into Wiren Board controller
Module for integrating the Shtyl UPS into the Wiren Board controller.

## Installation
## 🛠 Installation

On Wiren Board controller:
* **Step 1:** Clone the repository:

```bash
git clone https://github.com/subs1stem/wb-shtyl.git /opt/wb-shtyl
```
git clone https://github.com/subs1stem/wb-shtyl.git
cd wb-shtyl
chmod +x install.sh
./install.sh

* **Step 2:** Run the installation script:

```bash
# Make the install.sh script executable
chmod +x /opt/wb-shtyl/install.sh

# Run the installation script
/opt/wb-shtyl/install.sh
```

## Usage
* **Step 3:** Configure the .env file:

Edit the file at the path `/mnt/data/etc/wb-shtyl/settings.py` and use `systemctl start wb-shtyl.service` for running
module
```bash
nano /opt/wb-shtyl/.env
```

* **Step 4:** Start service:

```bash
systemctl start wb-shtyl.service
```
31 changes: 18 additions & 13 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
#!/bin/bash
apt install python3-dev python3-venv

echo 'Creating service...'
cp -u -r service/wb-shtyl.service /etc/systemd/system/
echo 'Installing Python and necessary packages...'
apt update
apt install -y python3-dev python3-venv python3-pip

echo 'Creating systemd service symlink...'
ln -s /opt/wb-shtyl/systemd/wb-shtyl.service /etc/systemd/system/wb-shtyl.service
systemctl daemon-reload
systemctl enable wb-shtyl.service

cp -u -r source /mnt/data/etc/wb-shtyl && cd /mnt/data/etc/wb-shtyl || exit

echo 'Installing venv...'
python3 -m venv venv
source venv/bin/activate
echo 'Setting up virtual environment...'
python3 -m venv /opt/wb-shtyl/venv
source /opt/wb-shtyl/venv/bin/activate

echo 'Installing requirements...'
pip install -r requirements.txt
echo 'Installing Python dependencies...'
pip install -r /opt/wb-shtyl/requirements.txt
deactivate

echo '--------------------------------------------------------------------'
echo 'Done. Edit the settings.py file at the path /mnt/data/etc/wb-shtyl.'
echo 'Use "systemctl start wb-shtyl.service" for running module.'
echo 'Copying .env.example to .env...'
cp /opt/wb-shtyl/.env.example /opt/wb-shtyl/.env

echo '---------------------------------------------------------------------------'
echo 'Installation complete!'
echo 'Please configure the .env file located at: /opt/wb-shtyl/.env'
echo 'To start the wb-shtyl service, use: systemctl start wb-shtyl.service'

0 comments on commit 79bc11a

Please sign in to comment.