Skip to content

Commit

Permalink
fix quick install
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyrix126 committed May 30, 2024
1 parent e23c00f commit 6555750
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ Simple rust program to format and return response of any API you want in a human

A script exist for Debian to automate the installation.
```bash
curl https://raw.githubusercontent.com/Cyrix126/api-formatter/docs/quick-install.sh | sh
curl https://raw.githubusercontent.com/Cyrix126/api-formatter/main/docs/quick-install.sh | sh
```
17 changes: 14 additions & 3 deletions docs/quick-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,25 @@ then
sudo mkdir -p /opt/api-formatter /etc/api-formatter
# set right permission to directories
sudo chown -R $USER /opt/api-formatter /etc/api-formatter

# download binary
rm -f /opt/api-formatter/api-formatter-linux-amd64
wget -q -P /opt/api-formatter/ https://github.com/Cyrix126/api-formatter/releases/download/v0.1.0/api-formatter-linux-amd64
# set execution permission for binary
sudo chmod +x /opt/api-formatter/api-formatter-linux-amd64
# download configuration

# download configuration if it doesnt' exist.
if [! -f /etc/api-formatter/config.toml ]
then
wget -q -P /etc/api-formatter/config.toml https://raw.githubusercontent.com/Cyrix126/api-formatter/main/docs/config.toml
# download systemd service
sudo wget -q -P /etc/systemd/system https://raw.githubusercontent.com/Cyrix126/api-formatter/main/docs/api-formatter.service # reload systemctl and enable service at boot
fi
if [! -f /etc/api-formatter/config.toml ]
then
# download systemd service if it doesn't exist
sudo wget -q -P /etc/systemd/system https://raw.githubusercontent.com/Cyrix126/api-formatter/main/docs/api-formatter.service
fi

# reload systemctl and enable service at boot
sudo systemctl-daemon reload
sudo systemctl enable api-formatter
sudo systemctl stop api-formatter
Expand Down

0 comments on commit 6555750

Please sign in to comment.