0

How to put telegram mtproto's secret codes in a file and then read it? first I made

nano /etc/systemd/system/MTProxy.service

and then past this code

[Unit]
Description=MTProxy
After=network.target

[Service]
Type=simple
WorkingDirectory=/opt/MTProxy/
ExecStart=/opt/MTProxy/objs/bin/mtproto-proxy -u nobody -p 8888 -H  443 -P a228$ -S a704c6af27e86da1eccf7e66c46c7324 -S cd305c6ce6d02ce57eee8fec3eab09b5 -S e0b157fdf6809e136dfef71bf5692d7f --aes-pwd proxy-secret  proxy-multi.conf -M 1
Restart=on-failure

[Install]
WantedBy=multi-user.target

because I have 31 Secret code and it's hard to put them in a line like

-S <secret> -S <secret> -S <secret> -S <secret> -S <secret> -S <secret> -S <secret> -S <secret> -S <secret> 

I need to put Secret codes in a file and then simply insert them in

ExecStart=/opt/MTProxy/objs/bin/mtproto-proxy -u nobody -p 8888 -H  443 -P a228$ -S HEREEEEEEEEEEEEEE --aes-pwd proxy-secret  proxy-multi.conf -M 1
Restart=on-failure
  • 1
    I'm not seeing a huge difference in the amount of work between writing the passwords in the unit file with -S ahead of each one versus writing them in a password file. Would the password file be maintained independently? – Jeff Schaller May 1 at 9:46
  • Write a simple shell script that reads your "secret code" file line by line, and generates -S arguments for each line, and then calls mtproto-proxy with these arguments. Call your script instead of mtproto-proxy from the systemd unit. – dirkt May 2 at 6:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.