This commit is contained in:
Justin (shocknet) 2024-08-15 21:01:46 -04:00
parent 23e19f7de1
commit bf598d9bd4
3 changed files with 12 additions and 12 deletions

View file

@ -1,6 +1,17 @@
#!/bin/bash #!/bin/bash
set -e 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" SCRIPT_VERSION="0.1.0"
cleanup() { cleanup() {
@ -31,7 +42,7 @@ modules=(
"extract_nprofile" "extract_nprofile"
) )
echo "Script version $SCRIPT_VERSION" log "Script version $SCRIPT_VERSION"
for module in "${modules[@]}"; do for module in "${modules[@]}"; do
wget -q "${BASE_URL}/${module}.sh" -O "/tmp/${module}.sh" || log_error "Failed to download ${module}.sh" 1 wget -q "${BASE_URL}/${module}.sh" -O "/tmp/${module}.sh" || log_error "Failed to download ${module}.sh" 1

View file

@ -84,8 +84,6 @@ install_lightning_pub() {
log "${PRIMARY_COLOR}Full log available in $USER_HOME/lightning_pub/npm_install.log${RESET_COLOR}" log "${PRIMARY_COLOR}Full log available in $USER_HOME/lightning_pub/npm_install.log${RESET_COLOR}"
return 1 return 1
fi fi
log "npm dependencies installed successfully."
return 0 return 0
} }

View file

@ -3,16 +3,7 @@
PRIMARY_COLOR="\e[38;5;208m" PRIMARY_COLOR="\e[38;5;208m"
SECONDARY_COLOR="\e[38;5;165m" SECONDARY_COLOR="\e[38;5;165m"
RESET_COLOR="\e[0m" 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() { detect_os_arch() {
OS="$(uname -s)" OS="$(uname -s)"