Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'net/ftp'
- $cartella = 'Mind_blog_v1.1'
- $username = 'your_username'
- $password = 'your_password'
- $host = 'your_ftp' # ex: ftp.pitagora.hellospace.net
- class CMS
- def installa
- ftp = Net::FTP.new($host)
- ftp.login($username, $password)
- ftp.mkdir($cartella)
- ftp.chdir($cartella)
- ftp.close
- end
- def aggiungi(nome_file)
- @file = nome_file
- ftp = Net::FTP.new($host)
- ftp.login($username, $password)
- ftp.chdir($cartella)
- ftp.putbinaryfile(@file)
- ftp.close
- end
- end
- mind_blog = CMS.new
- stringa = ARGV[0]
- if stringa == nil
- print "Errore, avviare mind_blog!\n"
- elsif stringa == '-add'
- mind_blog.aggiungi(ARGV[1])
- elsif stringa == '-install'
- mind_blog.installa
- else
- print "Errore, avviare mind_blog!\n"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement