This example turns teler into a service, then implements inotifywatch
to monitor the configuration file for changes. This way teler will automatically load on start on boot, and when config.yaml
changes the teler
service will restart and load the changes.
- Install
inotify-tools
apt-get -y install inotify-tools
-
Move
teler
(binary) to/usr/local/bin
-
Create folder
/opt/teler
mkdir -p /opt/teler
- Put
.sh
andconfig.yaml
files in that folder - Make the files executable
chmod +x teler.sh
chmod +x teler-watcher.sh
- Put
.service
files in/etc/systemd/system/
- Reload
systemd
manager configuration
systemctl daemon-reload
- Enable services
systemctl enable teler.service
systemctl enable teler-watcher.service
- Adjust variable paths in
config.yaml
as needed - Start services
systemctl start teler.service
systemctl start teler-watcher.service