Merge branch 'master' of https://git.schuerz.at/public/myshellconfig
This commit is contained in:
commit
d57439c132
6 changed files with 49 additions and 27 deletions
|
@ -139,6 +139,11 @@ EOF
|
|||
export PATH
|
||||
fi
|
||||
|
||||
if [ -d "${HOME}/.local/bin" ] ; then
|
||||
pathmunge "${HOME}/.local/bin"
|
||||
export PATH
|
||||
fi
|
||||
|
||||
# Check for interactive bash and that we haven't already been sourced.
|
||||
if [ -n "${BASH_VERSION-}" -a -n "${PS1-}" -a -z "${BASH_COMPLETION_VERSINFO-}" ]; then
|
||||
|
||||
|
|
|
@ -33,18 +33,25 @@ cat << EOF >> "${MYSHELLCONFIG_LOGFILE}"
|
|||
+-----BEGINN git update repo $(date) -------------------------------+
|
||||
EOF
|
||||
|
||||
case $1 in
|
||||
-h)
|
||||
# Headless repo local
|
||||
PRE="${MYSHELLCONFIG_GIT_REMOTE_NAME}"
|
||||
;;
|
||||
-s)
|
||||
dosubmodupdate="true"
|
||||
;;
|
||||
*)
|
||||
PRE=""
|
||||
;;
|
||||
esac
|
||||
set -- $(getopt -u -o hs --long headless,submodules-update -- "$@" )
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
-h|--headless)
|
||||
# Headless repo local
|
||||
PRE="${MYSHELLCONFIG_GIT_REMOTE_NAME}"
|
||||
shift
|
||||
;;
|
||||
-s|--submodules-update)
|
||||
dosubmodupdate="true"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
PRE=""
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
# If TAG is set, checkout is always headless.
|
||||
[ -z "${MYSHELLCONFIG_GIT_TAG:+x}" ] || { export MYSHELLCONFIG_GIT_BRANCH=${MYSHELLCONFIG_GIT_TAG}; export PRE=""; }
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
RESTART=true
|
||||
|
||||
set -- $(getopt -u -o n --long no-restart -- "$@" )
|
||||
CONFDIR="${HOME}/.local/$(basename $0)"
|
||||
TIMESTAMP=$(date "+%x-%X")
|
||||
set -- $(getopt -u -o ng: --long no-restart,gvapplid: -- "$@" )
|
||||
|
||||
while [ $# -gt 0 ];
|
||||
do
|
||||
|
@ -13,6 +14,10 @@ do
|
|||
shift
|
||||
continue
|
||||
;;
|
||||
-g|--gvapplid)
|
||||
GVAPPLID=$2
|
||||
shift; shift;
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
DESTS=($@)
|
||||
|
@ -25,17 +30,24 @@ done
|
|||
|
||||
for DEST in ${DESTS[*]}
|
||||
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
|
||||
*cnf*|*conf*)
|
||||
[ -z "${file-x}" ] && file="${HOME}/.local/$(basename $0)/confluence"
|
||||
libdir=/opt/atlassian/confluence/confluence/WEB-INF/lib
|
||||
[ -z "${file-x}" ] && file="${CONFDIR%/}/confluence"
|
||||
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
|
||||
appuser=confluence
|
||||
;;
|
||||
*jra*|*jira*)
|
||||
[ -z "${file-x}" ] && file="${HOME}/.local/$(basename $0)/jira"
|
||||
libdir=/opt/atlassian/jira/atlassian-jira/WEB-INF/lib
|
||||
[ -z "${file-x}" ] && file="${CONFDIR%/}/jira"
|
||||
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
|
||||
appuser=jira
|
||||
;;
|
||||
|
@ -46,8 +58,7 @@ do
|
|||
esac
|
||||
|
||||
echo "Using configfile $file"
|
||||
runtime=$(date "+%x-%X")
|
||||
UNINSTALLDIR="${HOME}/UNINSTALL/${runtime}/"
|
||||
UNINSTALLDIR="\${HOME}/UNINSTALL/${TIMESTAMP}/"
|
||||
|
||||
if stat "${file}" >/dev/null 2>/dev/null ; then
|
||||
echo "Stop $app on ${DEST}"
|
||||
|
@ -103,8 +114,9 @@ EOF
|
|||
esac
|
||||
unset cmd pkg version
|
||||
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
|
||||
echo "Configfile ${file} not found"
|
||||
fi
|
||||
|
|
|
@ -560,7 +560,6 @@ function checkbkp-full() {
|
|||
$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
|
||||
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
|
||||
|
||||
else
|
||||
|
@ -799,7 +798,6 @@ loadagent() {
|
|||
loginfo "Load agent from $af"
|
||||
unset SSH_AUTH_SOCKET SSH_AGENT_PID
|
||||
eval $(<$af)
|
||||
# . $af
|
||||
logdebug "SSH_AUTH_SOCK: ${SSH_AUTH_SOCK-not set}"
|
||||
logdebug "SSH_AGENT_PID: ${SSH_AGENT_PID-not set}"
|
||||
loginfo "currently loaded keys in agent:
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 75b8cca3b3d0663ea4102f08c763cf2b0b999f88
|
||||
Subproject commit 7bd99a22eeba74c88ad60f860111247a052f5586
|
|
@ -1 +1 @@
|
|||
Subproject commit 731bdb11d2f57365e02bdb8adaeb59a8b93db27d
|
||||
Subproject commit 536667191d5bdc0afa3a18d7df229731e778815e
|
Loading…
Reference in a new issue