Page 1 sur 1

[Bash] Pisg - Envoie de fichier sur un FTP distant

Posté : mar. 3 sept. 2013 21:39
par Dakin Quelia
» Pisg - Envoie de fichier sur un FTP distant

Ce petit code vous permet d'envoyer via votre serveur un fichier HTML de l'Eggdrop Pisg vers un serveur FTP distant.

Code : Tout sélectionner

#!/bin/bash

# Auteur: Dakin Quelia
cd "/home/ircd/Eggdrops/Pisg/htmls/"
echo -n "Voulez-vous générer la page Statistique d'un salon?"
remoteserver = "ftp.hebergeur.org"
remotepath = "/"
username = "bdd_user"
password = "mdp_user"

echo -n "Pour quel salon souhaitez-vous générer les statistiques?"
read channel
ftp -n "${remoteserver}" <<END_SCRIPT 
quote USER "${username}"
quote PASS "${password}" 
cd "${remotepath}"
put "${channel}.html"
quit
END_SCRIPT
echo -n "Vous avez créé une page Statistique pour le salon ${channel} !"   
exit;