FreedomPrevails / JSMTProxy

High Performance NodeJS MTProto Proxy
MIT License
314 stars 129 forks source link

Auto start after reboot #18

Open shaahinhs opened 6 years ago

shaahinhs commented 6 years ago

How to reboot the mtproxy.js file automatically? or "pm2 start mtproxy.js -i max" command

-- I do not have much information from nodejs

HavijTeam commented 6 years ago

If You Use Windows Server You I Have One Way For Do This Bro. First You Need To Open New Notepad File Second Insert This Code In Your Notepad And Save With .bat @ECHO pm2 start mtproxy.js_File_Address -i max echo Server Started pause For Example: @ECHO pm2 start C:\JSMTProxy\mtproxy.js -i max echo Server Started pause Second You Need Open Command Prompt And Use This Code. schtasks /create /sc onlogon /tn NAME /tr FILE_ADDRESS Name: You Can Choose Any Name For Your Task File_Address: Where Your Bat File Is There. For Example: schtasks /create /sc onlogon /tn MTProto /tr C:\Users\Administrator\Desktop\MTprotoLuncher.bat

@shaahinhs

shaahinhs commented 6 years ago

@ErfanDevelop3r sorry , my OS centos 6.9

gladiators1980 commented 6 years ago

After sure script is run Type

pm2 startup

pm2 save

alimami commented 6 years ago

@ErfanDevelop3r unfortunately this method didn't work in windows server 2012 r2.

do you have any suggestions?