linux:telegram
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:telegram [2015/07/01 20:06] – rlunaro | linux:telegram [2022/12/02 21:02] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 54: | Line 54: | ||
| ===== Step 4: a basic test ===== | ===== Step 4: a basic test ===== | ||
| - | Make a simple confirmation that the program is working. The program is called '' | + | Make a simple confirmation that the program is working. |
| + | |||
| + | The program is called '' | ||
| < | < | ||
| Line 63: | Line 65: | ||
| < | < | ||
| - | rluna@gamora: | + | $: |
| Telegram-cli version 1.0.5, Copyright (C) 2013-2014 Vitaly Valtman | Telegram-cli version 1.0.5, Copyright (C) 2013-2014 Vitaly Valtman | ||
| Telegram-cli comes with ABSOLUTELY NO WARRANTY; for details type `show_license' | Telegram-cli comes with ABSOLUTELY NO WARRANTY; for details type `show_license' | ||
| Line 85: | Line 87: | ||
| ===== Step 5: install the client ===== | ===== Step 5: install the client ===== | ||
| - | I've opted for manually install the client. I've copied the '' | + | I've opted for manually install the client. I've copied the '' |
| < | < | ||
| - | sudo cp telegram-cli | + | # mkdir /usr/local/share/ |
| - | sudo cp tg-server.pub | + | # cp telegram-cli /usr/local/share/ |
| - | sudo chmod g=r, | + | |
| </ | </ | ||
| - | ===== Step 6: create a daemon and install it ===== | + | I've also created a directory called ''/ |
| + | |||
| + | </ | ||
| + | # mkdir / | ||
| + | # chmod u=rwx, | ||
| + | # cp tg-server.pub / | ||
| + | # chmod g=r,o=r,u=r / | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Step 6: create the system user telegramd ===== | ||
| + | |||
| + | In order to run the telegram-daemon as root, you will need to create the user telegramd. I've opted | ||
| + | to create this user as a system user: | ||
| + | |||
| + | < | ||
| + | # useradd -M --user-group --system --shell=/ | ||
| + | </ | ||
| + | |||
| + | |||
| + | Impersonate this user and run the telegram-cli program again, to create a proper configuration file: | ||
| + | |||
| + | < | ||
| + | telegramd@: | ||
| + | Telegram-cli version 1.0.5, Copyright (C) 2013-2014 Vitaly Valtman | ||
| + | Telegram-cli comes with ABSOLUTELY NO WARRANTY; for details type `show_license' | ||
| + | This is free software, and you are welcome to redistribute it | ||
| + | under certain conditions; type `show_license' | ||
| + | Telephone number (with ' | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | ===== Step 7: create a daemon and install it ===== | ||
| Telegram-cli has a bug that provokes that, unless '' | Telegram-cli has a bug that provokes that, unless '' | ||
| Line 116: | Line 151: | ||
| ### END INIT INFO | ### END INIT INFO | ||
| - | TELEGRAM_BIN="/ | + | TELEGRAM_BIN="/ |
| TELEGRAM_PORT=1234 | TELEGRAM_PORT=1234 | ||
| - | TELEGRAM_ARGS=" | + | TELEGRAM_ARGS=" |
| PID_FILE=/ | PID_FILE=/ | ||
| Line 169: | Line 204: | ||
| + | Install it under ''/ | ||
| + | < | ||
| + | sudo mv telegram-daemon /etc/init.d | ||
| + | sudo chown root:root / | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Step 8: install the telegram-msg program ===== | ||
| + | |||
| + | After that I've created a '' | ||
| + | |||
| + | < | ||
| + | #!/bin/bash | ||
| + | # | ||
| + | # telegram-msg - sends a telegram message | ||
| + | # | ||
| + | # | ||
| + | |||
| + | |||
| + | echo "msg $1 $2" | nc 127.0.0.1 1234 | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Step 8: first test ===== | ||
| + | |||
| + | < | ||
| + | $ sudo / | ||
| + | $ telegram-msg somebody "some message you want to send" | ||
| + | </ | ||
linux/telegram.1435781211.txt.gz · Last modified: 2022/12/02 21:02 (external edit)
