add logging
This commit is contained in:
parent
17199a5a30
commit
b83d80ef90
@ -12,6 +12,7 @@ CM="${GN}✓${CL}"
|
||||
APP="Mystic BBS"
|
||||
MSDIR="/opt/mystic"
|
||||
MSTEMPDIR="/usr/local/src/mystic"
|
||||
INSTALLLOG=$MSTEMPDIR/install.log
|
||||
TMP_DIR=$(mktemp -d)
|
||||
SCRIPT_VER="v7"
|
||||
|
||||
@ -39,6 +40,13 @@ function error_exit() {
|
||||
exit $EXIT
|
||||
}
|
||||
|
||||
function cmd_exec() {
|
||||
{
|
||||
printf "$(date '+%Y-%m-%d %H:%M:%S') %s\n" "$*"
|
||||
"$@"
|
||||
} >> $INSTALLLOG
|
||||
}
|
||||
|
||||
if command -v pveversion >/dev/null 2>&1; then echo -e "⚠️ Can't Install on Proxmox "; exit; fi
|
||||
while true; do
|
||||
read -p "This will Install ${APP} on $hostname. Proceed(y/n)?" yn
|
||||
@ -60,9 +68,11 @@ function msg_ok() {
|
||||
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
||||
}
|
||||
|
||||
mkdir -p $MSTEMPDIR &>/dev/null
|
||||
|
||||
msg_info "Installing needed base packages"
|
||||
apt update &>/dev/null
|
||||
apt install lsb-release dpkg-dev wget curl figlet lolcat unzip whiptail dialog -y &>/dev/null
|
||||
cmd_exec apt update &>$INSTALLLOG
|
||||
cmd_exec apt install lsb-release dpkg-dev wget curl figlet lolcat unzip whiptail dialog -y &>$INSTALLLOG
|
||||
msg_ok "Installing needed base packages"
|
||||
|
||||
function header_info {
|
||||
|
Loading…
Reference in New Issue
Block a user