Git Product home page Git Product logo

Comments (7)

digi74 avatar digi74 commented on September 18, 2024 1

I am thrilled!
It works after changing from "#!/bin/bash" to "#!/bin/sh" in the script.
THANKS

from spksrc.

hgy59 avatar hgy59 commented on September 18, 2024

@digi74 what do you need expect for?
AFAICS expect requires tcl and is hard to cross compile.

from spksrc.

digi74 avatar digi74 commented on September 18, 2024

Thanks for asking!
A backup script that connects to switches via telnet and pulls a configuration backup. Unfortunately these devices do not support ssh.
I thought it might be easy, not in this case, no problem
:)

from spksrc.

hgy59 avatar hgy59 commented on September 18, 2024

Thanks for asking! A backup script that connects to switches via telnet and pulls a configuration backup. Unfortunately these devices do not support ssh. I thought it might be easy, not in this case, no problem :)

Don't give up so fast, I have done some progress, I tend to include expect in the synocli-misc package.

EDIT:
Everything builds successfully, except the sample scripts (those fail to create since the cross compiled tclsh is not executable).
But I think we do not need those scripts in the package (those are: timed-run timed-read ftp-rfc autopasswd lpunlock weather passmass rftp kibitz rlogin-cwd xpstat tkpasswd dislocate xkibitz tknewsbiff unbuffer mkpasswd cryptdir decryptdir autoexpect multixterm)

from spksrc.

digi74 avatar digi74 commented on September 18, 2024

I think you really don't need the examples.
an example of my telnet part of the script:

`
expect - <<EOF
set timeout 10
spawn ssh -l$username "$hostname"
expect "password"
send $password
send "\r"
expect "continue"
send "\r"
expect "#"
send "copy startup-config tftp fs1 $tftpfolder/$filename pc\r"
sleep 3

send "exit\r"
expect "#"
send "exit\r"
expect ">"
send "quit\r"
expect "log out"
send "y"

EOF
`

regards us gsiberg

from spksrc.

hgy59 avatar hgy59 commented on September 18, 2024

@digi74 you can download the synocli-misc package created by github build action
https://github.com/SynoCommunity/spksrc/actions/runs/9847463175

you need to extract the spk file from the artifacts-zip-file for the arch of you model, then you can manually install the spk File in the DSM package center.

from spksrc.

hgy59 avatar hgy59 commented on September 18, 2024

@digi74 thanks for the feedback.

Indeed, the example scripts use /bin/sh too

#!/bin/sh
# -*- tcl -*-
# The next line is executed by /bin/sh, but not tcl \
exec tclsh "$0" ${1+"$@"}

package require Expect

...

from spksrc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.