Created
January 16, 2015 01:36
-
-
Save calum-github/97743e99b9bc854f4361 to your computer and use it in GitHub Desktop.
Java 2014-001 scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Applications/Utilities/Java Preferences.app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ! -e "$3/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" ]; | |
then | |
/bin/ln -s "/System/Library/Java/Support/CoreDeploy.bundle/Contents/JavaAppletPlugin.plugin" "$3/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
my $wd = `pwd`; | |
chomp($wd); | |
system( $wd . "/Tools/deleteomatic", | |
$ARGV[2], | |
$wd . "/cleanup-list" ); | |
######################################################## | |
# always exit 0 | |
exit 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
my $ROOT_DIR = $ARGV[0]; | |
my $DATA_FILE = $ARGV[1]; | |
open (FILE, $DATA_FILE) || die ; | |
while (defined (my $deleteme = <FILE>)) { | |
$deleteme =~ /^\s*(.+?)\s*$/; | |
$deleteme = $1; | |
if (length($deleteme) > 0) | |
{ | |
deleteTree($ROOT_DIR . $deleteme); | |
} | |
} | |
sub deleteTree | |
{ | |
my $path = $_[0]; | |
if (-e $path) | |
{ | |
if (-d $path | |
&& !(-l $path)) | |
{ | |
local* THEDIR; | |
my $file; | |
opendir THEDIR, $path; | |
while ($file = readdir THEDIR) | |
{ | |
if ($file ne '.' && $file ne '..') | |
{ | |
deleteTree($path . "/" . $file); | |
} | |
} | |
closedir THEDIR; | |
rmdir $path; | |
} else { | |
unlink $path; | |
} | |
} else { | |
if (-l $path) | |
{ | |
unlink $path; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These are the scripts from the JavaEssentials.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
$0 =~ m/.*\/(.*)$/; | |
my $stage = $1; | |
my $action = $ARGV[3]; | |
my $wd = `pwd`; | |
chomp($wd); | |
my $actionsDir = $wd . "/" . 'postinstall' . "_actions/"; | |
my $upgradeDir = $wd . "/" . 'postupgrade' . "_actions/"; | |
my $upgrade = 0; | |
my $debug = 1; | |
my $count; | |
if ( $0 =~ /postupgrade/ || $0 =~ /preupgrade/ || $action =~ /upgrade/) { | |
system("logger -p install.info 'Upgrade scripts will be run.'") if ( $debug ); | |
$upgrade = 1; | |
} | |
if ( $stage =~ /pre/ ) | |
{ | |
$actionsDir = $wd . "/" . 'preinstall' . "_actions/"; | |
$upgradeDir = $wd . "/" . 'preupgrade' . "_actions/"; | |
} | |
if ( $upgrade == 1 && -e $upgradeDir ) { | |
system("logger -p install.info 'Running Upgrade Scripts . . .'") if ( $debug ); | |
$count = 0; | |
foreach my $action (`/bin/ls \Q$upgradeDir\E`) { | |
chomp($action); | |
system("logger -p install.info 'Begin script: $action'") if ( $debug ); | |
system($upgradeDir . $action, $ARGV[0], $ARGV[1], $ARGV[2], $ARGV[3]); | |
system("logger -p install.info 'End script: $action'") if ( $debug ); | |
$count++; | |
} | |
system("logger -p install.info '$count Upgrade Scripts run.'") if ( $debug ); | |
} | |
if ( -e $actionsDir ) { | |
system("logger -p install.info 'Running Install Scripts . . .'") if ( $debug ); | |
$count = 0; | |
foreach my $action (`/bin/ls \Q$actionsDir\E`) { | |
chomp($action); | |
system("logger -p install.info 'Begin script: $action'") if ( $debug ); | |
system($actionsDir . $action, $ARGV[0], $ARGV[1], $ARGV[2], $ARGV[3],$upgrade); | |
system("logger -p install.info 'End script: $action'") if ( $debug ); | |
$count++; | |
} | |
system("logger -p install.info '$count Install Scripts run.'") if ( $debug ); | |
} | |
exit(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment