Skip to content

Commit ec5ae24

Browse files
FEATURE (installation): Allow to launch installation script only under the root
1 parent 395de87 commit ec5ae24

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ The installation script will:
6464
- ✅ Set up automatic startup on system reboot via cron
6565

6666
```bash
67-
apt-get install -y curl && \
68-
curl -sSL https://raw.githubusercontent.com/RostislavDugin/postgresus/refs/heads/main/install-postgresus.sh | bash
67+
sudo apt-get install -y curl && \
68+
sudo curl -sSL https://raw.githubusercontent.com/RostislavDugin/postgresus/refs/heads/main/install-postgresus.sh \
69+
| sudo bash
6970
```
7071

7172
### Option 2: Manual Docker Compose Setup

install-postgresus.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/bin/bash
22

3+
# Check if script is run as root
4+
if [ "$(id -u)" -ne 0 ]; then
5+
echo "Error: This script must be run as root (sudo ./install-postgresus.sh)" >&2
6+
exit 1
7+
fi
8+
39
# Set up logging
410
LOG_FILE="/var/log/postgresus-install.log"
511
INSTALL_DIR="/opt/postgresus"

0 commit comments

Comments
 (0)