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
1 parent
afe3528
commit 18d5b34
Showing
3 changed files
with
45 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Create systemd service | ||
|
||
Copy zbot service definition. | ||
``` | ||
sudo cp zbot.service /etc/systemd/system/zbot.service | ||
sudo cp zbot.default /etc/default/zbot | ||
sudo chmod 664 /etc/systemd/system/zbot.service | ||
``` | ||
|
||
Enable and start zbot service | ||
|
||
``` | ||
sudo systemctl daemon-reload | ||
sudo systemctl enable zbot | ||
sudo systemctl start zbot | ||
sudo systemctl status zbot | ||
``` | ||
|
||
Create symlink | ||
|
||
```` | ||
sudo ln -s /path/to//zbot-telegram-go-linux-amd64 /usr/local/bin/zbot | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
#ZBOT configuration | ||
|
||
ZBOT_TOKEN="" | ||
ZBOT_LOG_LEVEL=debug | ||
ZBOT_DATABASE_TYPE=sqlite | ||
ZBOT_MODULES_PATH="/home/zbot/modules" | ||
ZBOT_DISABLED_COMMANDS="/home/zbot/disabled_commands.json" | ||
ZBOT_SQLITE_DATABASE="/home/zbot/db/database.db" |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=Zbot as a Service | ||
|
||
[Service] | ||
EnvironmentFile=/etc/default/zbot | ||
ExecStart=/usr/local/bin/zbot | ||
ExecStop=kill $(ps aux | grep '/usr/local/bin/zbot' | grep -v grep | awk '{print $2}') | ||
User=zbot | ||
Group=zbot | ||
|
||
[Install] | ||
WantedBy=multi-user.target |