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