Merge branch 'master' of bmi-desktop:/srv/git/myshellconfig
This commit is contained in:
commit
90c657cc89
2 changed files with 23 additions and 13 deletions
|
@ -1,8 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
RESTART=true
|
RESTART=true
|
||||||
|
CONFDIR="${HOME}/.local/$(basename $0)"
|
||||||
set -- $(getopt -u -o n --long no-restart -- "$@" )
|
TIMESTAMP=$(date "+%x-%X")
|
||||||
|
set -- $(getopt -u -o ng: --long no-restart,gvapplid: -- "$@" )
|
||||||
|
|
||||||
while [ $# -gt 0 ];
|
while [ $# -gt 0 ];
|
||||||
do
|
do
|
||||||
|
@ -13,6 +14,10 @@ do
|
||||||
shift
|
shift
|
||||||
continue
|
continue
|
||||||
;;
|
;;
|
||||||
|
-g|--gvapplid)
|
||||||
|
GVAPPLID=$2
|
||||||
|
shift; shift;
|
||||||
|
;;
|
||||||
--)
|
--)
|
||||||
shift
|
shift
|
||||||
DESTS=($@)
|
DESTS=($@)
|
||||||
|
@ -25,17 +30,24 @@ done
|
||||||
|
|
||||||
for DEST in ${DESTS[*]}
|
for DEST in ${DESTS[*]}
|
||||||
do
|
do
|
||||||
file="$(find ${HOME}/.local/$(basename $0)/ -name ${DEST})"
|
file="$(find ${CONFDIR%/}/ -name ${DEST})"
|
||||||
|
gvapplid=$(awk -v hostname="$(ssh ${DEST} hostname)" '$0 ~ hostname {print $1}' ${CONFDIR%/}/gvapplid)
|
||||||
case ${DEST} in
|
case ${DEST} in
|
||||||
*cnf*|*conf*)
|
*cnf*|*conf*)
|
||||||
[ -z "${file-x}" ] && file="${HOME}/.local/$(basename $0)/confluence"
|
[ -z "${file-x}" ] && file="${CONFDIR%/}/confluence"
|
||||||
libdir=/opt/atlassian/confluence/confluence/WEB-INF/lib
|
homedir=/var/atlassian/application-data/confluence
|
||||||
|
installdir=/opt/atlassian/confluence
|
||||||
|
libdir=${installdir%/}${installdir:+/}confluence/WEB-INF/lib
|
||||||
|
classesdir=${installdir%/}${installdir:+/}confluence/WEB-INF/classes
|
||||||
app=confluence
|
app=confluence
|
||||||
appuser=confluence
|
appuser=confluence
|
||||||
;;
|
;;
|
||||||
*jra*|*jira*)
|
*jra*|*jira*)
|
||||||
[ -z "${file-x}" ] && file="${HOME}/.local/$(basename $0)/jira"
|
[ -z "${file-x}" ] && file="${CONFDIR%/}/jira"
|
||||||
libdir=/opt/atlassian/jira/atlassian-jira/WEB-INF/lib
|
homedir=/var/atlassian/application-data/jira
|
||||||
|
installdir=/opt/atlassian/jira
|
||||||
|
libdir=${installdir%/}${installdir:+/}atlassian-jira/WEB-INF/lib
|
||||||
|
classesdir=${installdir%/}${installdir:+/}atlassian-jira/WEB-INF/classes
|
||||||
app=jira
|
app=jira
|
||||||
appuser=jira
|
appuser=jira
|
||||||
;;
|
;;
|
||||||
|
@ -46,8 +58,7 @@ do
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "Using configfile $file"
|
echo "Using configfile $file"
|
||||||
runtime=$(date "+%x-%X")
|
UNINSTALLDIR="\${HOME}/UNINSTALL/${TIMESTAMP}/"
|
||||||
UNINSTALLDIR="${HOME}/UNINSTALL/${runtime}/"
|
|
||||||
|
|
||||||
if stat "${file}" >/dev/null 2>/dev/null ; then
|
if stat "${file}" >/dev/null 2>/dev/null ; then
|
||||||
echo "Stop $app on ${DEST}"
|
echo "Stop $app on ${DEST}"
|
||||||
|
@ -103,8 +114,9 @@ EOF
|
||||||
esac
|
esac
|
||||||
unset cmd pkg version
|
unset cmd pkg version
|
||||||
done
|
done
|
||||||
echo "Start $app on ${DEST}"
|
|
||||||
ssh ${DEST} systemctl start ${app}.service </dev/null
|
$RESTART && echo "Start ${app} on ${DEST}" || echo "Do not restart ${app} on ${DEST}"
|
||||||
|
$RESTART && ssh ${DEST} systemctl start ${app}.service </dev/null
|
||||||
else
|
else
|
||||||
echo "Configfile ${file} not found"
|
echo "Configfile ${file} not found"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -560,7 +560,6 @@ function checkbkp-full() {
|
||||||
$CMD /bin/bash << EOF
|
$CMD /bin/bash << EOF
|
||||||
sudo find /srv/nfs/backup -mindepth 1 -maxdepth 1|grep -v -e "git$\|git-backup-repos"|while read i;do printf "%-30s%s\\n" "\$i" \$(ls \$i|tail -n1);done|sort -k 2.1 -r
|
sudo find /srv/nfs/backup -mindepth 1 -maxdepth 1|grep -v -e "git$\|git-backup-repos"|while read i;do printf "%-30s%s\\n" "\$i" \$(ls \$i|tail -n1);done|sort -k 2.1 -r
|
||||||
EOF
|
EOF
|
||||||
#which pdsh 1>/dev/null 2>&1 && pdsh -g hetzner-servers sudo systemctl status backup.service
|
|
||||||
which pdsh 1>/dev/null 2>&1 && pdsh -g vpn sudo systemctl status backup.service
|
which pdsh 1>/dev/null 2>&1 && pdsh -g vpn sudo systemctl status backup.service
|
||||||
|
|
||||||
else
|
else
|
||||||
|
@ -799,7 +798,6 @@ loadagent() {
|
||||||
loginfo "Load agent from $af"
|
loginfo "Load agent from $af"
|
||||||
unset SSH_AUTH_SOCKET SSH_AGENT_PID
|
unset SSH_AUTH_SOCKET SSH_AGENT_PID
|
||||||
eval $(<$af)
|
eval $(<$af)
|
||||||
# . $af
|
|
||||||
logdebug "SSH_AUTH_SOCK: ${SSH_AUTH_SOCK-not set}"
|
logdebug "SSH_AUTH_SOCK: ${SSH_AUTH_SOCK-not set}"
|
||||||
logdebug "SSH_AGENT_PID: ${SSH_AGENT_PID-not set}"
|
logdebug "SSH_AGENT_PID: ${SSH_AGENT_PID-not set}"
|
||||||
loginfo "currently loaded keys in agent:
|
loginfo "currently loaded keys in agent:
|
||||||
|
|
Loading…
Reference in a new issue