Browse Source

Amelioration verif fichier

Julien Vaubourg 12 years ago
parent
commit
db56db0744
2 changed files with 10 additions and 4 deletions
  1. 1 1
      fdnTopicAddBot/INSTALL
  2. 9 3
      fdnTopicAddBot/fdn-accbot.pl

+ 1 - 1
fdnTopicAddBot/INSTALL

@@ -2,7 +2,7 @@ apt-get install libbot-basicbot-perl
 
 mv fdn-accbot.pl /usr/local/bin/
 mv fdn-accbot /etc/init.d/
-mv 07-fdn /etc/apache2/sites-available
+mv 07-fdn /etc/apache2/sites-available/
 mkdir -p /var/www/fdn/ /var/log/apache2/fdn/
 touch /var/www/fdn/index.html
 

+ 9 - 3
fdnTopicAddBot/fdn-accbot.pl

@@ -1,17 +1,23 @@
 #!/usr/bin/perl
+# git clone http://repo.ldn-fai.net/repo/si-public.git
 
 package Bot;
 use base qw(Bot::BasicBot);
 use warnings;
 use strict;
 
-if(! -w $ARGV[0]) {
-	print "ERREUR: $ARGV[0] est inexistant ou non-inscriptible.\n";
+if(@ARGV && ! -w "$ARGV[0]" || !@ARGV) {
+	if(@ARGV) {
+		print "ERREUR: $ARGV[0] est inexistant ou non-inscriptible.\n";
+	} else {
+		print "USAGE: ./$0 fichier-a-ecrire\n";
+	}
+
 	exit 1;
 }
 
 my $nick = "accbot";
-my $chan = "#fdnbottest";
+my $chan = "#fdnbotteste";
 my $url = "http://fdn.ldn-fai.net";
 my $file = $ARGV[0];
 my $flag = "[ACC]";