Skip to content

Commit c609966

Browse files
committed
Update readme, add easy installation script
1 parent 442d8e1 commit c609966

File tree

2 files changed

+63
-54
lines changed

2 files changed

+63
-54
lines changed

README.md

Lines changed: 23 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@ This tool provides real-time monitoring of your Raspberry Pi's system statistics
1313

1414
## 📖 Table of Contents
1515

16-
1. [Features](#🌟-features)
17-
2. [Installation](#📦-installation)
18-
1. [Download](#📥-download)
19-
1. [Pre-built binaries](#pre-built-binaries)
20-
2. [Cargo](#cargo)
21-
2. [Configuration](#📝-configuration)
22-
3. [Building](#🛠️-building)
16+
- [🦀🍇 RustBerry-PoE-Monitor](#-rustberry-poe-monitor)
17+
- [📖 Table of Contents](#-table-of-contents)
18+
- [🌟 Features](#-features)
19+
- [📦 Installation](#-installation)
20+
- [Easy Installation](#easy-installation)
21+
- [Manual Installation](#manual-installation)
22+
- [📝 Configuration](#-configuration)
23+
- [🛠️ Building](#️-building)
24+
- [Prerequisites](#prerequisites)
25+
- [Building for Raspberry Pi](#building-for-raspberry-pi)
26+
- [🏃‍♂️ Running](#️-running)
2327

2428

2529
## 🌟 Features
@@ -31,66 +35,31 @@ This tool provides real-time monitoring of your Raspberry Pi's system statistics
3135

3236
## 📦 Installation
3337

34-
### 📥 Download
35-
First, you will need the binary file. You can either download the pre-built binaries or download it using cargo.
38+
### Easy Installation
3639

37-
#### Pre-built binaries
38-
Pre-built binaries are available for download on the [releases page](https://github.com/jackra1n/RustBerry-PoE-Monitor/releases)
39-
40-
To be able to run the binary anywhere on your system, you can move it to `/usr/local/bin`:
40+
Run the following command to install:
4141
```bash
42-
sudo mv rustberry-poe-monitor /usr/local/bin
42+
curl -sSL https://raw.githubusercontent.com/jackra1n/RustBerry-PoE-Monitor/main/install.sh | sudo bash
4343
```
4444

45-
#### Cargo
46-
47-
Install with `cargo`:
48-
```bash
49-
cargo install rustberry-poe-monitor
50-
```
45+
And that's it!
5146

52-
### 📝 Configuration
47+
### Manual Installation
5348

54-
You should be able to run the binary file now:
55-
```bash
56-
rustberry-poe-monitor
57-
```
49+
Check out the [wiki page](https://github.com/jackra1n/RustBerry-PoE-Monitor/wiki/Manual-Installation) to learn how to install manually.
5850

59-
There are 2 CLI arguments available:
60-
- `--temp-on` - The temperature at which the fan should turn on (default: 60)
61-
- `--temp-off` - The temperature at which the fan should turn off (default: 50)
51+
## 📝 Configuration
6252

63-
Example:
64-
```bash
65-
rustberry-poe-monitor --temp-on 65 --temp-off 55
66-
```
67-
68-
To run the program on startup, you can create a systemd service:
69-
```bash
70-
sudo nano /etc/systemd/system/rustberry-poe-monitor.service
71-
```
53+
To change the fan on/off temperature, you can add `temp-on` and `temp-off` arguments to the application.
54+
If you installed the application using the install script, you can edit the systemd service file to change the arguments.
7255

73-
Paste the following into the file:
7456
```bash
75-
[Unit]
76-
Description=RustBerry PoE Monitor
77-
After=network.target
78-
79-
[Service]
80-
ExecStart=/home/yourUser/.cargo/bin/rustberry-poe-monitor
81-
User=yourUser
82-
Restart=always
83-
RestartSec=30
84-
85-
[Install]
86-
WantedBy=multi-user.target
57+
sudo nano /etc/systemd/system/rustberry-poe-monitor.service
8758
```
8859

89-
Then enable the service:
60+
Change the `ExecStart` line to the following:
9061
```bash
91-
sudo systemctl daemon-reload
92-
sudo systemctl enable rustberry-poe-monitor.service
93-
sudo systemctl start rustberry-poe-monitor.service
62+
ExecStart=/usr/local/bin/rustberry-poe-monitor --temp-on 60 --temp-off 50
9463
```
9564

9665

install.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
LATEST_RELEAST_URL="https://github.com/jackra1n/RustBerry-PoE-Monitor/releases/latest/download/rustberry-poe-monitor"
3+
4+
# Check if script is run as root
5+
if [ "$EUID" -ne 0 ]
6+
then echo "Please run as root"
7+
exit
8+
fi
9+
10+
# Download latest binary from github and place it in /usr/local/bin
11+
echo "Downloading latest binary from github"
12+
curl -sSL $LATEST_RELEAST_URL -o /usr/local/bin/rustberry-poe-monitor
13+
14+
# Make binary executable
15+
chmod +x /usr/local/bin/rustberry-poe-monitor
16+
17+
# Create systemd service
18+
echo "Creating systemd service"
19+
sudo cat <<EOF > /etc/systemd/system/rustberry-poe-monitor.service
20+
[Unit]
21+
Description=RustBerry PoE Monitor
22+
After=network.target
23+
24+
[Service]
25+
ExecStart=/usr/local/bin/rustberry-poe-monitor
26+
Restart=always
27+
RestartSec=30
28+
29+
[Install]
30+
WantedBy=multi-user.target
31+
EOF
32+
33+
# Enable service
34+
echo "Enabling systemd service"
35+
sudo systemctl daemon-reload
36+
sudo systemctl enable rustberry-poe-monitor.service
37+
sudo systemctl start rustberry-poe-monitor.service
38+
39+
echo "Installation complete"
40+

0 commit comments

Comments
 (0)