Skip to content

Commit

Permalink
Version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
EnriqueMoran authored Jun 21, 2018
1 parent 2b31f67 commit 9f895e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@
appdevice = Telegram


# Operative System - Choose between "Linux" and "Windows" OS, although user inputs commands,
# Operative System - Choose between "Linux" and "Windows" OS, although user inputs commands,
# there are a set of pre established commands that depends on the OS in which
# remoteTelegramShell.py is running.
os = Linux


# Version - This parameter is automatically filled. Current version will be shown on /help
# option. Please do not modify.
version = v0.2_6.7.5
version = v1.0


# TOKEN - This is bot auth token, necessary to connect bot to Telegram device.
token =


# Password - New users will need to use it in order to access to the service. Logged users
# ID will be stored in users.txt. If there are users stored and you want to change the
# ID will be stored in users.txt. If there are users stored and you want to change the
# password, you MUST delete users.txt file or its content.
password =


# usersFile - Absolute path to users.txt. This file content is granted access users. Will be
# usersFile - Absolute path to users.txt. This file content is granted access users. Will be
# checked on every command the bot recieves. Users ID will be hashed and stored in order to
# preserve anonymity. Default value is the directory remoteTelegramShell.py is located at.
# It MUST be changed with absolute path.
Expand Down
9 changes: 5 additions & 4 deletions telegramShellBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
OS = None # currently working on Linux
LOGLIMIT = None # max number of lines allowed
APP = None # currently working app is Telegram
FORBIDDENCOMMANDS = ["wait", "exit", "clear", "aptitude", "raspi-config", "nano", "dc", "htop", "ex", "expand", "top", "vim"] # non working commands
FORBIDDENCOMMANDS = ["wait", "exit", "clear", "aptitude", "raspi-config", "nano", "dc", "htop", "ex", "expand", "top", "vim", "man", "apt-get", "poweroff", "reboot", "ssh", "scp", "wc"] # non working commands


def loadConfig(configFile):
Expand Down Expand Up @@ -296,10 +296,11 @@ def run(message):
if p.returncode != 0:
bot.send_message(message.chat.id, "error " + str(p.stdout.read()))
except Exception as e:
error = "Error ocurred: " + str(e)
errorType = "Error type: " + str((e.__class__.__name__))
#error = "Error ocurred: " + str(e)
#errorType = "Error type: " + str((e.__class__.__name__))
error = "Error: Command not found"
bot.send_message(message.chat.id, str(error))
bot.send_message(message.chat.id, str(errorType))
#bot.send_message(message.chat.id, str(errorType))


def register(file, user): # register user and allow him to access the system
Expand Down

0 comments on commit 9f895e9

Please sign in to comment.