Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant send message from bash script #1680

Open
andy-1983 opened this issue Oct 28, 2020 · 1 comment
Open

Cant send message from bash script #1680

andy-1983 opened this issue Oct 28, 2020 · 1 comment

Comments

@andy-1983
Copy link

Im just writing simple bash script

`#!/bin/bash -x

SUFFIX="daily_1_08"

MESSAGE="FAIL | pd_dump | PostgreSQL | ${SUFFIX}"

echo "${MESSAGE}"

EXECCMD=""msg Admins_message ""$MESSAGE""

echo "${EXECCMD}"

/root/tg/bin/telegram-cli -k /root/tg/tg-server.pub --disable-output --wait-dialog-list --exec "${EXECCMD}"
`

Its output

`

  • SUFFIX=daily_1_08
  • MESSAGE='FAIL | pd_dump | PostgreSQL | daily_1_08'
  • echo 'FAIL | pd_dump | PostgreSQL | daily_1_08'
    FAIL | pd_dump | PostgreSQL | daily_1_08
  • EXECCMD='"msg Admins_message ""FAIL | pd_dump | PostgreSQL | daily_1_08"'
  • echo '"msg Admins_message ""FAIL | pd_dump | PostgreSQL | daily_1_08"'
    "msg Admins_message ""FAIL | pd_dump | PostgreSQL | daily_1_08"
  • /root/tg/bin/telegram-cli -k /root/tg/tg-server.pub --disable-output --wait-dialog-list --exec '"msg Admins_message ""FAIL | pd_dump | PostgreSQL | daily_1_08"'
    change_user_group: can't find the user telegramd to switch to
    FAIL: 38: can not parse modifier

All done. Exit
halt

`

But when I start command from command line all work fine, what is a problem?

`
root@Debian9:~# /root/tg/bin/telegram-cli -k /root/tg/tg-server.pub --disable-output --wait-dialog-list --exec "msg Admins_message ""FAIL | pd_dump | PostgreSQL | daily_1_08"
change_user_group: can't find the user telegramd to switch to

All done. Exit
halt

`

@Paulchen232
Copy link

First install and start it without root.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants