[Asterisk-cvs] asterisk/contrib/scripts astxs,1.1,1.2

anthm at lists.digium.com anthm at lists.digium.com
Thu Apr 29 15:48:58 CDT 2004


Update of /usr/cvsroot/asterisk/contrib/scripts
In directory mongoose.digium.com:/tmp/cvs-serv17950/contrib/scripts

Modified Files:
	astxs 
Log Message:
update astxs utility to allow auto load/unload and url compile


Index: astxs
===================================================================
RCS file: /usr/cvsroot/asterisk/contrib/scripts/astxs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- astxs	26 Apr 2004 23:22:33 -0000	1.1
+++ astxs	29 Apr 2004 19:55:46 -0000	1.2
@@ -95,6 +95,27 @@
 
 my($base,$ext);
 my $cfile = $args{plain}->[0];
+
+
+if($cfile =~ /http:\/\/.*?\/([^\/]+)$/) {
+
+  my $f = $1;
+  if(! -d "/tmp/astbld") {
+    mkdir("/tmp/astbld");
+  }
+  my $pwd = `pwd`;
+  chomp $pwd;
+  chdir("/tmp/astbld");
+  system("/bin/rm $f");
+  system("wget $cfile");
+  chdir($pwd);
+  $cfile = "/tmp/astbld/$f";
+
+
+}
+
+
+
 if($cfile) {
   ($base,$ext) = $cfile =~ /^([^\.]+)\.(.)/;
 }
@@ -109,6 +130,16 @@
 $bad = esystem("$vars{CC} $vars{SOLINK} -o $vars{LDFLAGS} ${base}.so $base.o $vars{EXTOBJ}") if(!$bad);
 
 if($args{install} and $vars{MODULES_DIR}) {
+  my $file = "${base}.so";
+  my ($mod) = $file =~ /([^\/]*)$/;
+
+  if($args{autoload}) {
+    $bad = esystem("/usr/sbin/asterisk -rx 'unload $mod'");
+  }
   $bad = esystem("/bin/cp -p ${base}.so $vars{MODULES_DIR}") if(!$bad);
+  
+  if($args{autoload}) {
+    $bad = esystem("/usr/sbin/asterisk -rx 'load $mod'");
+  }
 }
 




More information about the svn-commits mailing list