-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
42 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |