1: #!/usr/bin/perl
2:
3: # loncapaautoupgrade
4:
5: # This tool does "all the things" to auto update a system.
6: # Use with extreme caution so that you do not lose your
7: # work.
8:
9: # Scott Harrison, 10/25/2000
10:
11: use strict;
12:
13: # Download most recent LON-CAPA RPM
14:
15: print `/usr/bin/lynx -term xterm -source http://install.lon-capa.org/3.1/loncapafiles/LON-CAPA-base-3.1-1.i386.rpm > /tmp/LON-CAPA-base-3.1-1.i386.rpm`;
16:
17: # Stop LON-CAPA
18:
19: print "Stopping LON-CAPA and Apache\n";
20: system("/etc/rc.d/init.d/loncontrol stop");
21: system("/etc/rc.d/init.d/httpd stop");
22: system("/etc/rc.d/init.d/atalkd stop");
23: system("/etc/rc.d/init.d/smb stop");
24: system("/etc/rc.d/init.d/xntpd stop");
25:
26: # Update downloaded RPM
27:
28: print `/bin/rpm -Uvh --force /tmp/LON-CAPA-base-3.1-1.i386.rpm`;
29:
30: # Restore configuration values
31:
32: print `/usr/sbin/loncaparestoreconfigurations`;
33:
34: # Start LON-CAPA
35:
36: print "Starting LON-CAPA and Apache (be patient please)\n";
37: system("/etc/rc.d/init.d/loncontrol start");
38: system("/etc/rc.d/init.d/httpd start");
39: system("/etc/rc.d/init.d/atalkd start");
40: system("/etc/rc.d/init.d/smb start");
41: system("/etc/rc.d/init.d/xntpd start");
42:
43: # Verify base files and packages
44:
45: print `/usr/sbin/loncapaverify`;
46:
47: # Remove downloaded RPM
48:
49: print `/bin/rm -f /tmp/LON-CAPA-base-3.1-1.i386.rpm`;
50:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>