#!/bin/bash
jxplorer_home=/usr/share/jxplorer/

home="${HOME}/.jxplorer"

if [ ! -d "${home}" ]; then
	mkdir -v "${home}"
fi

try_create() {
	[[ ! -f "${1}" ]] && touch "${1}"
}

if [ -d ${HOME}/.jxplorer ]; then
	for file in search_filters.txt bookmarks.txt quicksearch.txt ; do 
		try_create "${home}/${file}"
	done
	for file in security.default csvconfig.txt.default ; do 
		[[ ! -e "${home}/${file}" ]] && \
			ln -vs "${jxplorer_home}/${file}" "${home}/${subdir}"
	done
	for subdir in htmldocs icons images templates plugins language ; do
		[[ ! -e "${home}/${subdir}" ]] && \
			ln -vs "${jxplorer_home}/${subdir}" "${home}/${subdir}"
	done
fi

gjl_package=jxplorer
gjl_main="com.ca.directory.jxplorer.JXplorer"
gjl_pwd=""${HOME}/.jxplorer""
source /usr/share/java-config-2/launcher/launcher.bash
