diff --git a/.githooks/post-checkout b/.githooks/post-checkout new file mode 100755 index 0000000..76812cf --- /dev/null +++ b/.githooks/post-checkout @@ -0,0 +1,56 @@ +#!/bin/bash - +# echo "POST-CHECKOUT" +# echo "PREV-HEAD=$1" +# echo "CURR-HEAD=$2" +# echo "BRANCH-CHECKOUT=$3" + +readonly CHECKOUT_HISTORY_FILE="/opt/app/tools/atbupdate/checkout_history" +readonly GIT_UPDATE_LOG="/opt/app/tools/atbupdate/update_log.csv" +readonly OPKG_COMMANDS_FILE="/etc/psa_update/opkg_commands" + +write_log_file () { + if [ -f $CHECKOUT_HISTORY_FILE ]; then + # repo: customer_281 + readonly repo=$(basename $(git rev-parse --show-toplevel)) + # branch: customer_281:HEAD->zg1/zone1,origin/zg1/zone1 + readonly branch=$(git log --graph --all --decorate $2 | head -n 1 | sed -E -e 's/(.*?)\((.*)\)/\2/g' | sed -E -e s/[[:space:]]//g) + readonly line="$repo:$branch" + readonly now="$(date +%Y-%m-%dT%T)" + 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.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 [ -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" >> $CHECKOUT_HISTORY_FILE + # echo "$line @$now" >> $CHECKOUT_HISTORY_FILE + else + echo "*******************************************************" + echo " $CHECKOUT_HISTORY_FILE DOES NOT EXIST !!! " + echo "*******************************************************" + fi +} + +write_log_file + diff --git a/etc/dc/dc2c.4.21.bin b/etc/dc/dc2c.4.21.bin new file mode 100755 index 0000000..0d6ce45 Binary files /dev/null and b/etc/dc/dc2c.4.21.bin differ diff --git a/etc/dc/dc2c.4.22.bin b/etc/dc/dc2c.4.22.bin new file mode 100755 index 0000000..5172732 Binary files /dev/null and b/etc/dc/dc2c.4.22.bin differ diff --git a/etc/psa_config/DC2C_print01.json b/etc/psa_config/DC2C_print01.json index 5c1a028..bd160c8 100644 --- a/etc/psa_config/DC2C_print01.json +++ b/etc/psa_config/DC2C_print01.json @@ -1,28 +1,38 @@ { "title":"DC2C_pri01", -"project":"DBM Szeged", -"version":"13.02.2023 12:20 00001", -"styl":"bold on", -"text":"Parkingticket ", -"styl":"bold off", +"project":"DBM Szeged park_coins", +"issued":"13.04.2023 01.02", +"styl":"font 08", +"styl":"size 10", +"feed":"margin02", +"feed":"rim02", +"text":"PARKOLÓJEGY", +"styl":"size 00", "feed":"nl", -"text":"Parkingticket ", -"styl":"under on", -"text":"Parkingticket ", -"styl":"under off", +"text":" Nyugta", "feed":"nl", -"text":"Parkingticket ", -"styl":"latin on", -"text":"Parkingticket ", -"styl":"latin off", +"text":"Kérjük az elsö szélvédö", "feed":"nl", -"text":"Parkingticket ", -"styl":"font 09", -"text":"Park ", -"styl":"font 16", -"text":"Park ", +"text":"mögé jól láthatóan", "feed":"nl", -"":"" +"text":"elhelyezni!", +"feed":"nl", +"text":"A PARKOLÓ NEM ÕRZÖTT", +"feed":"nl", +"feed":"nl", +"text":"Rendszám: ", +"vari":"Dynamic01", +"feed":"nl", +"text":"Parkolási idõ vége:", +"feed":"nl", +"styl":"size 01", +"vari":"Dynamic04", +"vari":"Dynamic03", +"styl":"size 00", +"feed":"nl", +"text":"Parkolás helye: ", +"feed":"nl", +"vari":"location", } diff --git a/etc/psa_config/DC2C_print02.json b/etc/psa_config/DC2C_print02.json index 4f68fb3..39c031d 100644 --- a/etc/psa_config/DC2C_print02.json +++ b/etc/psa_config/DC2C_print02.json @@ -1,5 +1,37 @@ -{ -"title":"DC2C_pri02", -"version":"27.02.2023 12:20 00001", -"":"" -} +{ +"title":"DC2C_pri02", +"project":"DBM Szeged park_coins", +"issued":"13.04.2023 01.01", + +"text":"Összeg: ", +"styl":"size 01", +"vari":"Dynamic02", +"styl":"size 00", +"feed":"nl", +"text":"Kiadás időpontja:", +"feed":"nl", +"vari":"date us", +"vari":"time short", +"feed":"nl", +"text":"Automata száma: ", +"vari":"manu", +"text":"Park.jegy sorsz.: ", +"vari":"TickCtr", +"feed":"nl", +"text":"Szegedi Közlekedési Kft", +"feed":"nl", +"text":"6720 Szeged ", +"feed":"nl", +"text":"Zrínyi utca 4-8", +"feed":"nl", +"text":"Adósz: 11092612-2-06", +"feed":"nl", +"text":"A jegy ára az ÁFA-t", +"feed":"nl", +"text":" tartalmazza!", +"feed":"nl", +"text":"Üf. szolg nyitvatartás:", +"feed":"nl", +} + + diff --git a/etc/psa_config/DC2C_print03.json b/etc/psa_config/DC2C_print03.json index 70d3229..512c8a0 100644 --- a/etc/psa_config/DC2C_print03.json +++ b/etc/psa_config/DC2C_print03.json @@ -1,5 +1,22 @@ -{ -"title":"DC2C_pri03", -"version":"27.02.2023 12:20 00001", -"":"" -} \ No newline at end of file +{ +"title":"DC2C_pri03", +"project":"DBM Szeged park_coins", +"issued":"13.04.2023 01.01", + +"styl":"size 00", +"text":"H - P: 7:45 - 17:00", +"feed":"nl", +"text":"Tel: (80) 820-500", +"feed":"nl", +"text":"Parkoljon egy érintéssel. ", +"feed":"nl", +"text":"Használja bankkártyáját ", +"feed":"nl", +"text":" automatáinknál is!", +"feed":"nl", +"feed":"nl", +"feed":"nl", +"feed":"eject", +} + + diff --git a/etc/psa_config/DC2C_print04.json b/etc/psa_config/DC2C_print04.json index 0cbb8bb..a7a91fa 100644 --- a/etc/psa_config/DC2C_print04.json +++ b/etc/psa_config/DC2C_print04.json @@ -1,5 +1,8 @@ -{ -"title":"DC2C_pri04", -"version":"27.02.2023 12:20 00001", -"":"" -} \ No newline at end of file +{ +"title":"DC2C_pri04", +"project":"empty", +"issued":"24.05.2023 01.00", +"text":"" +} + + diff --git a/etc/psa_config/DC2C_print29.json b/etc/psa_config/DC2C_print29.json index 1a21c69..3a8f572 100644 --- a/etc/psa_config/DC2C_print29.json +++ b/etc/psa_config/DC2C_print29.json @@ -1,5 +1,24 @@ -{ -"title":"DC2C_pri29", -"version":"27.02.2023 12:20 00001", -"":"" -} \ No newline at end of file +{ +"title":"DC2C_pri29", +"project":"ATB test", +"issued":"24.05.2023 01.00", +"styl":"font 08", +"styl":"size 11", +"feed":"margin02", +"feed":"rim02", +"text":"All 8 Variables:", +"feed":"nl", +"vari":"Dynamic01", +"vari":"Dynamic02", +"vari":"Dynamic03", +"vari":"Dynamic04", +"vari":"Dynamic05", +"vari":"Dynamic06", +"vari":"Dynamic07", +"vari":"Dynamic08", +"feed":"eject", + + +} + + diff --git a/etc/psa_config/DC2C_print32.json b/etc/psa_config/DC2C_print32.json index 4e2d318..5cf6645 100644 --- a/etc/psa_config/DC2C_print32.json +++ b/etc/psa_config/DC2C_print32.json @@ -1,6 +1,39 @@ -{ -"title":"DC2C_pri32", -"version":"27.02.2023 12:20 00001", -"":"", -"":"10001" -} +{ +"title":"DC2C_pri32", +"project":"DBM Szeged door", +"issued":"18.04.2023 01.01", +"styl":"font 08", +"styl":"size 10", +"feed":"margin02", +"feed":"rim02", +"styl":"size 11", +"text":"AJTÓ NYITÁS", +"feed":"nl", +"styl":"size 00", +"text":"Door closed", +"feed":"nl", +"feed":"nl", +"text":"CuNu: ", +"vari":"cunu", +"text":"MaNu: ", +"vari":"manu", +"text":"Place: ", +"vari":"location", +"text":"Group: ", +"vari":"group", +"text":"Zone: ", +"vari":"zone", +"text":"Name: ", +"vari":"alias", +"text":"Date: ", +"vari":"date us", +"text":"Time: ", +"vari":"time long", +"feed":"nl", +"text":" * * * * * * * * ", +"feed":"nl", +"feed":"nl", +"feed":"eject", +} + +