diff --git a/.githooks/post-checkout b/.githooks/post-checkout index 7646424..76812cf 100755 --- a/.githooks/post-checkout +++ b/.githooks/post-checkout @@ -19,29 +19,32 @@ write_log_file () { if ! grep -Eq "$line" $CHECKOUT_HISTORY_FILE; then # line not found. first checkout of this branch (on this PSA). # mark dc and print-templates to be downloaded by update-tool. - echo "DOWNLOAD, /etc/dc/dc2c.4.21.bin, $now, N/A" >> $GIT_UPDATE_LOG + echo "DOWNLOAD, /etc/dc/dc2c.bin, $now, N/A" >> $GIT_UPDATE_LOG echo "DOWNLOAD, /etc/psa_config/DC2C_print01.json, $now, N/A" >> $GIT_UPDATE_LOG echo "DOWNLOAD, /etc/psa_config/DC2C_print02.json, $now, N/A" >> $GIT_UPDATE_LOG echo "DOWNLOAD, /etc/psa_config/DC2C_print03.json, $now, N/A" >> $GIT_UPDATE_LOG echo "DOWNLOAD, /etc/psa_config/DC2C_print04.json, $now, N/A" >> $GIT_UPDATE_LOG echo "DOWNLOAD, /etc/psa_config/DC2C_print29.json, $now, N/A" >> $GIT_UPDATE_LOG echo "DOWNLOAD, /etc/psa_config/DC2C_print32.json, $now, N/A" >> $GIT_UPDATE_LOG - if grep -qE . "${OPKG_COMMANDS_FILE}"; then - readarray opkg_commands < <(cat $OPKG_COMMANDS_FILE) - for opkg_c in "${opkg_commands[@]}"; do - # check for lines longer than 'opkg ' - if [ "${#opkg_c}" -gt 4 ]; then - # comment: spaces, at least one '#' - grep -qE '^[[:space:]]*#+.*$' <<< "$opkg_c" && continue - echo -n "EXECUTE, $opkg_c, $now, N/A" | tr -d '\n\r' >> $GIT_UPDATE_LOG 2>&1 - echo "" >> $GIT_UPDATE_LOG 2>&1 - fi - done + if [ -f "$OPKG_COMMANDS_FILE" ]; then + if grep -qE . "${OPKG_COMMANDS_FILE}"; then + readarray opkg_commands < <(cat $OPKG_COMMANDS_FILE) + for opkg_c in "${opkg_commands[@]}"; do + # check for lines longer than 'opkg ' + if [ "${#opkg_c}" -gt 4 ]; then + # comment: spaces, at least one '#' + grep -qE '^[[:space:]]*#+.*$' <<< "$opkg_c" && continue + echo -n "EXECUTE, $opkg_c, $now, N/A" | tr -d '\n\r' >> $GIT_UPDATE_LOG 2>&1 + echo "" >> $GIT_UPDATE_LOG 2>&1 + fi + done + fi fi else echo "Found existing line: $line. Do nothing" fi - echo "$line @$now" >> $CHECKOUT_HISTORY_FILE + echo "$line" >> $CHECKOUT_HISTORY_FILE + # echo "$line @$now" >> $CHECKOUT_HISTORY_FILE else echo "*******************************************************" echo " $CHECKOUT_HISTORY_FILE DOES NOT EXIST !!! " diff --git a/etc/psa_config/DC2C_print10.json b/etc/psa_config/DC2C_print10.json index a6e6c16..47ab37f 100644 --- a/etc/psa_config/DC2C_print10.json +++ b/etc/psa_config/DC2C_print10.json @@ -1,5 +1,5 @@ { "title":"DC2C_pri10", "version":"27.02.2023 12:20 00001", -"test":"" +"test":"05062023-16:03" }