Compare commits
9 commits
73821828b4
...
129c3b0210
Author | SHA1 | Date | |
---|---|---|---|
|
129c3b0210 | ||
|
9a3b100378 | ||
|
607f3f7e16 | ||
|
d95e03bf64 | ||
|
eacb28b712 | ||
|
f8e4764feb | ||
|
92e6633e97 | ||
|
255fbf0907 | ||
|
797e4da5d1 |
4 changed files with 39 additions and 4 deletions
2
aliases
2
aliases
|
@ -8,6 +8,8 @@ alias apv="ansible-playbook --ask-vault-pass"
|
|||
alias fuck='sudo $(history -p \!\!)'
|
||||
alias wosis='which $(history -p \!\!)'
|
||||
alias fix='reset; stty sane; tput rs1; clear; echo -e "\033c"' # Fix terminal aber binary output
|
||||
alias fixbmi='ssh -Oexit svras' # Fix terminal aber binary output
|
||||
alias fixtoken='sudo systemctl restart pcscd.service' # Fix terminal aber binary output
|
||||
# Source https://www.digitalocean.com/community/tutorials/how-to-use-bash-history-commands-and-expansions-on-a-linux-vps
|
||||
alias vilastcatfile='vim $(history -p \!cat:$:t)'
|
||||
alias vio='vim $(history -p \!less:$:t)'
|
||||
|
|
4
aliases_remote
Normal file
4
aliases_remote
Normal file
|
@ -0,0 +1,4 @@
|
|||
alias deploypvp='getatsvc; TARGETDIR=/opt/atlassian/${APP_NAME}/${APP_INST_NAME}/WEB-INF/lib; COMCSV=$(ls -t /root/INSTALL/commons-csv* |head -n1); SETTINGS=$(ls -t /root/INSTALL/at.gv.bmi.atlassian.pvp.settings* |head -n1); PVP=$(ls -t /root/INSTALL/at.gv.bmi.atlassian.pvp.authenticator.*${SVC}* |head -n1); echo "Deploy $SETTINGS $PVP $COMCSV"; systemctl stop ${APP_NAME}.service ;rm ${TARGETDIR}/at.gv.bmi.* ${TARGETDIR}/$(basename $COMCSV); cp ${SETTINGS} ${PVP} ${COMCSV} ${TARGETDIR}/.; systemctl restart ${APP_NAME} --no-block ;tailatpvp'
|
||||
alias deploypvpandstop='getatsvc; TARGETDIR=/opt/atlassian/${APP_NAME}/${APP_INST_NAME}/WEB-INF/lib; COMCSV=$(ls -t /root/INSTALL/commons-csv* |head -n1); SETTINGS=$(ls -t /root/INSTALL/at.gv.bmi.atlassian.pvp.settings* |head -n1); PVP=$(ls -t /root/INSTALL/at.gv.bmi.atlassian.pvp.authenticator.*${SVC}* |head -n1); echo "Deploy $SETTINGS $PVP $COMCSV"; systemctl stop ${APP_NAME}.service ;rm ${TARGETDIR}/at.gv.bmi.* ${TARGETDIR}/$(basename $COMCSV); cp ${SETTINGS} ${PVP} ${COMCSV} ${TARGETDIR}/.'
|
||||
alias getpvpversion='for base in $(find /opt/atlassian -type d -name "WEB-INF"); do echo search in "$base"; find "${base}/lib" -name "*pvp*" -exec basename {} \; ; echo "---";done'
|
||||
|
36
functions.sh
36
functions.sh
|
@ -1201,18 +1201,31 @@ function connectdb () {
|
|||
getdbcreds_cnf $2
|
||||
;;
|
||||
*)
|
||||
echo "wrong argument"
|
||||
echo "wrong argument" >&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
cat << EOF
|
||||
cat << EOF >&2
|
||||
connect to ${DB_HOST}:${DB_PORT}/${DB_NAME}
|
||||
with user: ${DB_USER}
|
||||
and passwd: ${DB_PWD}
|
||||
and passwd: ${DB_PWD:+********}
|
||||
EOF
|
||||
|
||||
PGPASSWORD=$DB_PWD psql -h $DB_HOST -p $DB_PORT -U $DB_USER $DB_NAME
|
||||
if [ $# -gt 0 ]
|
||||
then
|
||||
case $1 in
|
||||
-c)
|
||||
shift
|
||||
PGPASSWORD=$DB_PWD psql -h $DB_HOST -p $DB_PORT -U $DB_USER $DB_NAME -c "$@"
|
||||
;;
|
||||
*)
|
||||
PGPASSWORD=$DB_PWD psql -h $DB_HOST -p $DB_PORT -U $DB_USER $DB_NAME $@
|
||||
;;
|
||||
esac
|
||||
else
|
||||
PGPASSWORD=$DB_PWD psql -h $DB_HOST -p $DB_PORT -U $DB_USER $DB_NAME
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
@ -1434,6 +1447,21 @@ EOF
|
|||
shopt -u extglob
|
||||
}
|
||||
|
||||
checkkernel () {
|
||||
for i in /vmlinuz /boot/vmlinuz
|
||||
do
|
||||
[ -e "${i}" ] || continue
|
||||
if [ $(basename $(readlink -f "${i}")) = vmlinuz-$(uname -r) ]
|
||||
then
|
||||
printf "%s\n" "Kein Upgrade notwendig. Kernel aktuell"
|
||||
else
|
||||
printf "%s\n" "Reboot notwendig!!"
|
||||
res=1
|
||||
fi
|
||||
return ${res:-0}
|
||||
done
|
||||
|
||||
}
|
||||
#EOF
|
||||
|
||||
|
||||
|
|
|
@ -5,5 +5,6 @@ $(getbashrcfile)
|
|||
${HOME}/.aliases
|
||||
${HOME}/.bash_aliases
|
||||
${MSC_BASE}/aliases
|
||||
${MSC_BASE}/aliases_remote
|
||||
${MSC_BASE}/PS1
|
||||
${MSC_BASE}/bash_completion.d/*
|
||||
|
|
Loading…
Reference in a new issue