Skip to content

Commit

Permalink
Check if telegram-cli is already running
Browse files Browse the repository at this point in the history
close #7
  • Loading branch information
Nanoseb committed Apr 18, 2016
1 parent feb675a commit a84e1b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ a message their path between single quotes (').
- Vim-like key bindings are also available, use `hjkl` to navigate between
lists, use `i` to select the text area and `esc` to leave it.

- Use Shift + Up or Shift + Down to navigate in your own message history.
- Use `shift + Up` or `shift + Down` to navigate in your own message history.

#### Troubleshooting

Expand Down
11 changes: 11 additions & 0 deletions nctelegram
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ import os.path
import configparser

import ncTelegram
import psutil



# Check if telegram-cli is already running on the same port
list_connection = [ i[4] for i in psutil.net_connections() ]
for connection in list_connection:
if connection and connection[1] == 4458:
print('telegram-cli is already running, kill it before starting ncTelegram')
sys.exit(1)



userconf = os.path.expanduser("~")+'/.ncTelegram.conf'
Expand Down

0 comments on commit a84e1b5

Please sign in to comment.