Jump to content

error trying to send a Linux command


Recommended Posts

When I try to send a Linux command the "/" dont appear...
/Etc/init.d/nfcepack_agente stop and start...

First the script call Putty, allready with user and password, then I try to send the stop , start command. But thats what happens...attached Photo....First command erase everything before "fcepack..." Second command trade the "/" for "^[" ... Looks like this because I removed the {ENTER} between commands...I tried to set the command as a variable and by Just send and quotes...

 

 

thanks in advance!

 

Link to comment
Share on other sites

Without any code to look at it is very difficult to help: I suggest you write a short replicator of your problem using a standard Linux command so anyone with telnet access to a Linux box can test the code. However, this thread contains all the basic information required to make a telnet connection (check the plink reference as well).

 

 

Edited by SlackerAl

Problem solving step 1: Write a simple, self-contained, running, replicator of your problem.

Link to comment
Share on other sites

1 hour ago, SlackerAl said:

Without any code to look at it is very difficult to help: I suggest you write a short replicator of your problem using a standard Linux command so anyone with telnet access to a Linux box can test the code. However, this thread contains all the basic information required to make a telnet connection (check the plink reference as well).

 

 

I Just sent: /etc/init.d/nfcepack_agente stop and start

Link to comment
Share on other sites

  • Developers
10 minutes ago, edumanilha said:

 

Hello!

How can I do this?

That's why a helpfile is supplied so you can have a look ;)

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

2 hours ago, Jos said:

That's why a helpfile is supplied so you can have a look ;)

Jos

I tried to use -m comandos.txt on the end of the putty open comand... But I get a "unable to open command file "comando.txt""

 

Inside the comando.txt = /etc/init.d/nfcepack_agente stop

Link to comment
Share on other sites

Plink is the command driven part of Putty its not a separate program, it should pretty much come with the same download/install, and it would be what you use for your automation, not a change in program for the person(s) to use for interactive sessions.

I have not used this in a while, but had it working with my firewall and access points at home and wrapped it into a AutoIT GUI for a control panel.

Dont forget you still have telnet on Windows CMD and even Linux on Windows 10 you can make use of, though I would prefer SSH if this is anything more than a lab environment. 

Link to comment
Share on other sites

On 1/24/2020 at 10:09 AM, ViciousXUSMC said:

Plink is the command driven part of Putty its not a separate program, it should pretty much come with the same download/install, and it would be what you use for your automation, not a change in program for the person(s) to use for interactive sessions.

I have not used this in a while, but had it working with my firewall and access points at home and wrapped it into a AutoIT GUI for a control panel.

Dont forget you still have telnet on Windows CMD and even Linux on Windows 10 you can make use of, though I would prefer SSH if this is anything more than a lab environment. 

$CMD = "C:\putty -ssh -pw password user@" & $Final & " -m " & @ScriptDir & "\RESTARTFISCAL.txt"  worked for me! Thanks guys!

Edited by edumanilha
Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...