HEX
Server: nginx/1.22.1
System: Linux iZuf67d4hh2ssx30nkok6dZ 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: www (1000)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: //bin/jvmjar
#!/bin/sh
#
# Small script to install a jar in multiple version-specific locations
#
# JPackage project
#
# $Id: jvmjar,v 1.1 2004/12/15 16:23:45 robert Exp $

# System-wide java configuration
JAVA_CONF="/etc/java/java.conf"

if [ -z "$JAVA_LIBDIR" ] ; then 
	[ -r "$JAVA_CONF" ] && . "$JAVA_CONF" || JAVA_LIBDIR="/usr/share/java"
fi

usage() {
cat << EOF_USAGE
Usage: $0 <l|u> <jar> <extension> <version> [<versionB> ... <versionZ>]
- l|u: link/unlink jars
- jar: name of the jar present in $JAVA_LIBDIR-ext to install as a jvm extension
       For example: jaf for $JAVA_LIBDIR-ext/jaf.jar
       Only required with -l
- extension: name under which the jar should be known in the jvm dirs
             For example: activation for activation.jar
             This is necessary when the same extension is provided by different
             jars depending on jvm version (i.e. classes.jar, classes12.jar and
             so on).
- versionX: versions of the java standard (1.2, 1.3...) that support this jar as
            an external extension
EOF_USAGE
exit 0
}

[ $# -lt 3 ] && usage

case "$1" in
    -l|--link|-c|--create)
	LINK="true"
	[ $# -lt 4 ] && usage
	shift
	ORIGINAL_JAR_NAME="$1"
	if ! [ -e "$JAVA_LIBDIR-ext/$ORIGINAL_JAR_NAME.jar" ] ; then
		echo "Could not find $JAVA_LIBDIR-ext/$ORIGINAL_JAR_NAME.jar" >&2
		exit 1
	fi
	;;
    -u|--unlink|-d|--delete)
	LINK="false"
	;;
    *)
	usage
esac

shift
EXTENSION_NAME="$1"
shift

for version in "$@" ; do
    if [ $LINK = "true" ] ; then
	[ -d $JAVA_LIBDIR-$version ] || install -d -m 755 $JAVA_LIBDIR-$version
	ln -fs "../java-ext/$ORIGINAL_JAR_NAME.jar" \
	    $JAVA_LIBDIR-$version/$EXTENSION_NAME.jar
    else
	rm -f "$JAVA_LIBDIR-$version/$EXTENSION_NAME.jar"
    fi
done