Skip to content

Commit

Permalink
attempt to log shell scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rootiest committed Jun 13, 2023
1 parent 7844086 commit a9d1c0e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/change_profile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ user_cfg=$config/user_config.cfg
old_user_cfg=$config/$repo/user_config.cfg
profile_pattern="# Profile:(.*)"

LOGFILE="$home/$repo/logs/change_profile.log"
exec 3>&1 1>"$LOGFILE" 2>&1
trap "echo 'ERROR: An error occurred during execution, check log $LOGFILE for details.' >&3" ERR
trap '{ set +x; } 2>/dev/null; echo -n "[$(date -Is)] "; set -x' DEBUG

# Check if any parameters were provided
if [ $# -eq 0 ]
then
Expand Down
5 changes: 5 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ moonraker=$config/moonraker.conf
# Set the default profile
default_src=default

LOGFILE="$home/$repo/logs/install.log"
exec 3>&1 1>"$LOGFILE" 2>&1
trap "echo 'ERROR: An error occurred during execution, check log $LOGFILE for details.' >&3" ERR
trap '{ set +x; } 2>/dev/null; echo -n "[$(date -Is)] "; set -x' DEBUG

# Check if any parameters were provided
if [ $# -eq 0 ]
then
Expand Down
5 changes: 5 additions & 0 deletions scripts/patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ uconfig_pattern_old="[include $repo/user_config.cfg]"
uconfig_pattern_new="[include user_config.cfg]"
ver_patch="# Patch: *"

LOGFILE="$home/$repo/logs/patch.log"
exec 3>&1 1>"$LOGFILE" 2>&1
trap "echo 'ERROR: An error occurred during execution, check log $LOGFILE for details.' >&3" ERR
trap '{ set +x; } 2>/dev/null; echo -n "[$(date -Is)] "; set -x' DEBUG

# Check if any parameters were provided
if [ $# -eq 0 ]
then
Expand Down
5 changes: 5 additions & 0 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ old_user_vars=$config/$repo/user_profile.cfg
user_cfg=$config/user_config.cfg
old_user_cfg=$config/$repo/user_config.cfg

LOGFILE="$home/$repo/logs/setup.log"
exec 3>&1 1>"$LOGFILE" 2>&1
trap "echo 'ERROR: An error occurred during execution, check log $LOGFILE for details.' >&3" ERR
trap '{ set +x; } 2>/dev/null; echo -n "[$(date -Is)] "; set -x' DEBUG

# Check if any parameters were provided
if [ $# -eq 0 ]
then
Expand Down

0 comments on commit a9d1c0e

Please sign in to comment.