2020-10-16 16:37:01 +02:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
2020-10-19 09:12:39 +02:00
|
|
|
|
file="$(find ${HOME}/.local/$(basename $0)/ -name $1)"
|
2020-10-16 16:37:01 +02:00
|
|
|
|
case $1 in
|
2020-10-19 09:12:39 +02:00
|
|
|
|
*cnf*|*conf*)
|
|
|
|
|
[ -z "${file-x}" ] && file="${HOME}/.local/$(basename $0)/confluence"
|
|
|
|
|
libdir=/var/atlassian/confluence/confluence/WEB-INF/lib
|
|
|
|
|
app=confluence
|
2020-10-16 16:37:01 +02:00
|
|
|
|
;;
|
2020-10-19 09:12:39 +02:00
|
|
|
|
*jra*|*jira*)
|
|
|
|
|
[ -z "${file-x}" ] && file="${HOME}/.local/$(basename $0)/jira"
|
|
|
|
|
libdir=/var/atlassian/atlassian-jira/jira/WEB-INF/lib
|
|
|
|
|
app=jira
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
echo "host ${1} not found -> exit"
|
|
|
|
|
exit
|
2020-10-16 16:37:01 +02:00
|
|
|
|
;;
|
|
|
|
|
esac
|
2020-10-19 09:12:39 +02:00
|
|
|
|
|
|
|
|
|
echo "Using configfile $file"
|
|
|
|
|
|
|
|
|
|
if stat "${file}" >/dev/null 2>/dev/null ; then
|
|
|
|
|
cat ${file}|sort -r |while read cmd pkg version ; do
|
|
|
|
|
case $cmd in
|
|
|
|
|
install)
|
|
|
|
|
package=$(find ~/.m2 -name "*${pkg}-${version}.jar")
|
|
|
|
|
if [ -n "${package-x}" ]; then
|
|
|
|
|
echo "$(basename ${package}) --> ${1}:/tmp"
|
|
|
|
|
scp ${package} ${1}:/tmp
|
|
|
|
|
echo " done"
|
|
|
|
|
else
|
|
|
|
|
echo "$pkg in version $version not found"
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
remove)
|
|
|
|
|
echo remove $pkg in all versions from server
|
|
|
|
|
echo ssh ${1} find $libdir -name "*${pkg}*"
|
|
|
|
|
ssh ${1} find $libdir -name $pkg
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
#scp $file ${1}:/tmp
|
|
|
|
|
done
|
|
|
|
|
else
|
|
|
|
|
echo "Configfile ${file} not found"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
#echo "copy files to ${1}"
|
|
|
|
|
#cd ${HOME}/git/bmi/at.gv.bmi.pvp.settings && scp "$(ls target/at.gv.bmi.pvp.settings*|sort -t"." -k 1,1 -k 2,2 -k 3,3|tail -n1)" ${1}:/tmp
|
|
|
|
|
#case $1 in
|
|
|
|
|
# cnf*)
|
|
|
|
|
# cd ${HOME}/git/bmi/at.gv.bmi.confluence.pvp-authenticator && scp "$(ls target/at.gv.bmi.confluence.pvp*|sort -t"." -k 1,1 -k 2,2 -k 3,3|tail -n1)" ${1}:/tmp
|
|
|
|
|
# ;;
|
|
|
|
|
# jra*)
|
|
|
|
|
# cd ${HOME}/git/bmi/pvp-authenticator && scp "$(ls target/at.gv.bmi.jira.pvp*|sort -t"." -k 1,1 -k 2,2 -k 3,3|tail -n1)" ${1}:/tmp
|
|
|
|
|
# ;;
|
|
|
|
|
#esac
|