logs
This commit is contained in:
parent
23e19f7de1
commit
bf598d9bd4
3 changed files with 12 additions and 12 deletions
|
|
@ -1,6 +1,17 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
LOG_FILE="/var/log/pubdeploy.log"
|
||||
|
||||
touch $LOG_FILE
|
||||
chmod 644 $LOG_FILE
|
||||
|
||||
log() {
|
||||
local message="$(date '+%Y-%m-%d %H:%M:%S') $1"
|
||||
echo -e "$message"
|
||||
echo -e "$(echo $message | sed 's/\\e\[[0-9;]*m//g')" >> $LOG_FILE
|
||||
}
|
||||
|
||||
SCRIPT_VERSION="0.1.0"
|
||||
|
||||
cleanup() {
|
||||
|
|
@ -31,7 +42,7 @@ modules=(
|
|||
"extract_nprofile"
|
||||
)
|
||||
|
||||
echo "Script version $SCRIPT_VERSION"
|
||||
log "Script version $SCRIPT_VERSION"
|
||||
|
||||
for module in "${modules[@]}"; do
|
||||
wget -q "${BASE_URL}/${module}.sh" -O "/tmp/${module}.sh" || log_error "Failed to download ${module}.sh" 1
|
||||
|
|
|
|||
|
|
@ -84,8 +84,6 @@ install_lightning_pub() {
|
|||
log "${PRIMARY_COLOR}Full log available in $USER_HOME/lightning_pub/npm_install.log${RESET_COLOR}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
log "npm dependencies installed successfully."
|
||||
|
||||
return 0
|
||||
}
|
||||
|
|
@ -3,16 +3,7 @@
|
|||
PRIMARY_COLOR="\e[38;5;208m"
|
||||
SECONDARY_COLOR="\e[38;5;165m"
|
||||
RESET_COLOR="\e[0m"
|
||||
LOG_FILE="/var/log/pubdeploy.log"
|
||||
|
||||
touch $LOG_FILE
|
||||
chmod 644 $LOG_FILE
|
||||
|
||||
log() {
|
||||
local message="$(date '+%Y-%m-%d %H:%M:%S') $1"
|
||||
echo -e "$message"
|
||||
echo -e "$(echo $message | sed 's/\\e\[[0-9;]*m//g')" >> $LOG_FILE
|
||||
}
|
||||
|
||||
detect_os_arch() {
|
||||
OS="$(uname -s)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue