1
0
Fork 0

update showlog

This commit is contained in:
VirtuBox 2019-11-13 13:53:47 +01:00
parent da45059f6e
commit e7bc810679
Signed by: virtubox
GPG Key ID: 22EB296C97BAD476
1 changed files with 27 additions and 9 deletions

View File

@ -14,12 +14,28 @@ command_exists() {
command -v "$@" >/dev/null 2>&1
}
_run() {
if [ -n "$2" ]; then
echo -ne "${TPUT_ECHO}${2}${TPUT_RESET}\t"
fi
if ! { "$1" >>"$wo_install_log" 2>&1; }; then
if [ -n "$2" ]; then
echo -e "${TPUT_FAIL}[KO]${TPUT_RESET}"
fi
else
if [ -n "$2" ]; then
echo -e "[${TPUT_OK}OK${TPUT_RESET}]"
fi
fi
}
apt_install() {
DEBIAN_FRONTEND=noninteractive apt-get install --option=Dpkg::options::=--force-confmiss --option=Dpkg::options::=--force-confold "$@" --assume-yes /dev/null 2>&1
}
transfer_vtbox_net() {
{ curl --progress-bar --upload-file "$1" https://transfer.vtbox.net/$(basename "$1") && echo ""; } | tee -a $HOME/.transfer.log && echo ""
{ curl --progress-bar --upload-file "$1" "https://transfer.vtbox.net/$(basename $1)" && echo ""; } | tee -a $HOME/.transfer.log && echo ""
}
compress_pigz() {
@ -222,12 +238,14 @@ EE_NGINX_COMPILE() {
EE_SHOW_LOG() {
{ [ -x /usr/bin/ccze ] && {
tail -n 500 "$1" | ccze -A -p syslog -C
}; } || {
if ! command_exists ccze; then
apt install ccze -y
fi
if grep -q ".gz" "$1"; then
zcat "$1" | ccze -A -p syslog -C
else
tail -n 500 "$1" | ccze -A -p syslog -C
}
fi
}
@ -585,11 +603,11 @@ _WO_FULL_UPGRADE() {
_SPEEDTEST() {
if ! command_exists speedtest; then
DEB_DISTRO=$(lsb_release -sc)
apt-get install gnupg1 apt-transport-https dirmngr -y
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 379CE192D401AB61
echo "deb https://ookla.bintray.com/debian ${DEB_DISTRO} main" | sudo tee /etc/apt/sources.list.d/speedtest.list
echo "deb https://ookla.bintray.com/debian $DEB_DISTRO main" | sudo tee /etc/apt/sources.list.d/speedtest.list
apt-get update
apt-get install gnupg1 apt-transport-https dirmngr -qq
apt-get install speedtest -qq
apt-get install speedtest -y
fi
speedtest
}
@ -703,6 +721,6 @@ alias vdir='vdir --color=auto'
alias wo-virtualenv=_PYTHON_VIRTUALENV
alias wp-fix-perms=_WP_PERMISSIONS
alias upgrade-wo-full=_WO_FULL_UPGRADE
alias speedtestnet=_SPEEDTEST
alias speedtestnet=_run _SPEEDTEST "Installing speedtest"
alias SSETUP=_SETUP_CONTROLLER
alias journalctfail='journalctl -b -p err -S "yesterday"'