Sponsored links


Go Back   Sat Industry Forums > French Forum > Forum Dreambox
Register FAQ Members List Calendar Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-27-2006
f4bian's Avatar
Moderator
 
Join Date: Mar 2005
Posts: 67
Thanks: 0
Thanked 1 Time in 1 Post
f4bian is on a distinguished road
[SCRIPT] Connexion auto en ftp et execution de shell Linux

Attention : VALABLE POUR ITGATE & DREAMBOX !


Bonjour à tous,

Persistant dans mes recherches, je trouvais dommage de ne pouvoir exploiter totalement un script de connexion automatique sans la flexibilité des shells Linux.

Heureusement ! il y a NcFTP !

Je vous laisse découvrir ci dessous.

@bientôt

****************** HOW TO *****************
0. NcFTP Permet certaines commandes linux ! Que la commande Windows FTP ne fait pas!
1. Récupérer le package pour Windows (Win32) ne Ncftp.
Website : http://www.ncftp.com/
2. Installer le package sur votre PC.
3. Editer ce fichier
4. Paramétrer l'ip de votre iTgate / Utilisateur et mot de passe
5. Entrer vos variables !

************ EXEMPLE DE COMMANDE ************
Changer les droits d'un fichier dans ./var/bin en 777
tgatecommand1=site chmod 777 ./var/bin/mon_fichier

************** COMMANDES NCFTP **************
ascii cat help lrm pdir rhelp umask
bgget cd lcd lrmdir pls rm version
bgput chmod lls ls put rmdir
bgstart close lmkdir mkdir pwd set
binary debug lookup open quit show
bookmark dir lpwd page quote site
bookmarks get lrename passive rename type


Code:
@rem *******************************************
@rem *   Auto-Connexion en FTP sur la iTgate   *
@rem *  avec NCFTP et chmod auto de fichiers   *
@rem * Date   : 22/03/2006                     *
@rem * Auteur : f4bian                         *
@rem * Forums : http://www.itgateusers.com     *
@rem *******************************************

@rem ****************** HOW TO *****************
@rem 0. NcFTP Permet certaines commandes linux ! Que la commande Windows FTP ne fait pas!
@rem 1. Récupérer le package pour Windows (Win32) ne Ncftp.
@rem    Website : http://www.ncftp.com/
@rem 2. Installer le package sur votre PC.
@rem 3. Editer ce fichier :)
@rem 4. Paramétrer l'ip de votre iTgate / Utilisateur et mot de passe
@rem 5. Entrer vos variables !

@rem ************ EXEMPLE DE COMMANDE ************
@rem Changer les droits d'un fichier dans ./var/bin en 777
@rem tgatecommand1=site chmod 777 ./var/bin/mon_fichier

@rem ************** COMMANDES NCFTP **************
@rem ascii      cat        help       lrm        pdir       rhelp      umask
@rem bgget      cd         lcd        lrmdir     pls        rm         version
@rem bgput      chmod      lls        ls         put        rmdir
@rem bgstart    close      lmkdir     mkdir      pwd        set
@rem binary     debug      lookup     open       quit       show
@rem bookmark   dir        lpwd       page       quote      site
@rem bookmarks  get        lrename    passive    rename     type

@rem ////// Editez les elements ci dessous concernant votre materiel
@set tgateboxip=192.168.0.3
@set tgateusername=root
@set tgatepassword=tgatebox
@set tgatecommand1=
@set tgatecommand2=
@set tgatecommand3=
@set tgatecommand4=
@set tgatecommand5=
@set tgatecommand6=
@set tgatecommand7=
@set tgatecommand8=
@set tgatecommand9=
@set tgatecommand10=

@rem ///// Ne plus rien modifier en dessous de cette ligne !

@rem ///// Creation du script VBS pour connexion automatique
@echo set sh=WScript.CreateObject("WScript.Shell")>>ncftp.vbs
@echo WScript.Sleep 500>>ncftp.vbs
@echo sh.SendKeys "open -u %tgateusername% -p %tgatepassword% %tgateboxip%">>ncftp.vbs
@echo WScript.Sleep 500>>ncftp.vbs
@echo sh.SendKeys "~">>ncftp.vbs
@echo Wscript.Sleep 5000>>ncftp.vbs

@rem ///// Lancement des commandes Telnet
@echo sh.SendKeys "%tgatecommand1%">>ncftp.vbs
@echo sh.SendKeys "~">>ncftp.vbs
@echo WScript.Sleep 500>>ncftp.vbs
@echo sh.SendKeys "%tgatecommand2%">>ncftp.vbs
@echo sh.SendKeys "~">>ncftp.vbs
@echo WScript.Sleep 500>>ncftp.vbs
@echo sh.SendKeys "%tgatecommand3%">>ncftp.vbs
@echo sh.SendKeys "~">>ncftp.vbs
@echo WScript.Sleep 500>>ncftp.vbs
@echo sh.SendKeys "%tgatecommand4%">>ncftp.vbs
@echo sh.SendKeys "~">>ncftp.vbs
@echo WScript.Sleep 500>>ncftp.vbs
@echo sh.SendKeys "%tgatecommand5%">>ncftp.vbs
@echo sh.SendKeys "~">>ncftp.vbs
@echo WScript.Sleep 500>>ncftp.vbs
@echo sh.SendKeys "%tgatecommand6%">>ncftp.vbs
@echo sh.SendKeys "~">>ncftp.vbs
@echo WScript.Sleep 500>>ncftp.vbs
@echo sh.SendKeys "%tgatecommand7%">>ncftp.vbs
@echo sh.SendKeys "~">>ncftp.vbs
@echo WScript.Sleep 500>>ncftp.vbs
@echo sh.SendKeys "%tgatecommand8%">>ncftp.vbs
@echo sh.SendKeys "~">>ncftp.vbs
@echo WScript.Sleep 500>>ncftp.vbs
@echo sh.SendKeys "%tgatecommand9%">>ncftp.vbs
@echo sh.SendKeys "~">>ncftp.vbs
@echo WScript.Sleep 500>>ncftp.vbs
@echo sh.SendKeys "%tgatecommand10%">>ncftp.vbs
@echo sh.SendKeys "~">>ncftp.vbs
@echo WScript.Sleep 500>>ncftp.vbs

@rem ///// Lancement de la session FTP sur l'iTgatebox
@start /realtime ncftp.exe
@cscript //nologo ncftp.vbs
@del /q ncftp.vbs
Attached Files
File Type: zip f4bian_ncftp.zip (1.1 KB, 3 views)

Last edited by f4bian : 03-27-2006 at 04:05 AM.
Reply With Quote
Sponsored links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
starting shell script with remote ? wallycharlo PLI Images 3 03-28-2006 04:48 AM
EPGUI auto update install script Doosje Plugins 22 05-31-2005 03:52 AM
How to run a shell script at boot ? stone_db The_Hydra Images 2 12-22-2004 07:05 AM
Zap from shell script? SatRider Tips, Tricks & Hints 5 02-08-2004 07:23 PM


All times are GMT +10. The time now is 03:34 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Page generated in 0.21066 seconds with 11 queries