6 Commits

20 changed files with 6125 additions and 6595 deletions

View File

@@ -1,53 +0,0 @@
#!/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.4.21.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
fi
else
echo "Found existing line: $line. Do nothing"
fi
echo "$line @$now" >> $CHECKOUT_HISTORY_FILE
else
echo "*******************************************************"
echo " $CHECKOUT_HISTORY_FILE DOES NOT EXIST !!! "
echo "*******************************************************"
fi
}
write_log_file

View File

@@ -11,9 +11,11 @@ if [ -z $IFS ]; then
IFS=$'\n' IFS=$'\n'
fi fi
GIT_UPDATE_LOG=/opt/app/tools/atbupdate/update_log.csv GIT_PULL_TMP=/tmp/git_changed_files_for_last_pull
OPKG_CMDS_TMP=/tmp/opkg_commands
#TODO: use in UpdateController rm -f $GIT_PULL_TMP
rm -f $OPKG_CMDS_TMP
get_blob () { # get the blob of the file(name) passed as $1 get_blob () { # get the blob of the file(name) passed as $1
# note: this can be used for any file in the filesystem # note: this can be used for any file in the filesystem
@@ -27,28 +29,26 @@ get_commit_for_blob () {
grep -q $1 && echo -n {} && head -n 1") grep -q $1 && echo -n {} && head -n 1")
} }
write_log_file () { for fn in $(git diff-tree -r HEAD@{1} HEAD --name-only); do
local now=$(date +"%Y-%m-%dT%T") if grep -E -q "(DC.*json|dc.*hex|dc.*bin|tariff.*json)" <<< $fn; then
for fn in $(git diff-tree -r HEAD@{1} HEAD --name-only); do
if grep -qE "(DC.*json|dc.*hex|dc.*bin|tariff.*json)" <<< $fn; then
# called in repository: $fn is e.g. etc/psa_tariff/tariff01.json # called in repository: $fn is e.g. etc/psa_tariff/tariff01.json
# add '/' prefix # add '/' prefix
echo "DOWNLOAD, $(echo $fn | awk '{ printf "/"$0 }'), $now, N/A" >> "$GIT_UPDATE_LOG" fn=$(echo $fn | awk '{ printf "/"$0 }')
if [[ -f "$fn" ]]; then
blob=$(get_blob "$fn")
commit=$(get_commit_for_blob $blob "$fn")
fsize=$(ls -l "$fn" | awk '{ print $5 }')
echo "$fn $fsize $blob $commit" >> $GIT_PULL_TMP
fi fi
if grep -qE ".*opkg_commands" <<< $fn; then fi
if grep -E -q ".*opkg_commands" <<< $fn; then
readarray opkg_commands < <(cat $fn) readarray opkg_commands < <(cat $fn)
for opkg_c in "${opkg_commands[@]}"; do for opkg_c in "${opkg_commands[@]}"; do
# check for lines longer than 'opkg ' test -z $opkg_c && continue;
if [ "${#opkg_c}" -gt 4 ]; then test ! -z $(grep -E "^\s*[#]+.*$" <<< $opkg_c) && continue
# comment: spaces, at least one '#' echo -n "$opkg_c" | tr -d '\n\r' >> $OPKG_CMDS_TMP 2>&1
grep -qE '^[[:space:]]*#+.*$' <<< "$opkg_c" && continue echo "" >> $OPKG_CMDS_TMP 2>&1
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 done
source "$fn"
fi fi
done done
}
write_log_file

35
.gitignore vendored
View File

@@ -1,27 +1,16 @@
# First, ignore everything
* *
# Now, whitelist anything that's a directory
!*/
# And all the file types you're interested in
!.gitignore
!.githooks/post-merge
!.githooks/post-checkout
!**/.gitignore
!**/.githooks/post-merge
!**/.githooks/post-checkout
## Except ## Except
!etc/atb/* !**/.gitignore
!etc/psa_config/* !**/.githooks/post-merge
!etc/psa_update/* !/etc/*.ini
!etc/psa_tariff/* !/etc/atb/*.ini
!etc/dc/*.hex !/etc/psa_config/*
!etc/dc/*.bin !/etc/psa_update/*
!*/etc/*.ini !/etc/psa_tariff/*
!*/etc/atb/* !/etc/dc/dc2c.hex
!*/etc/psa_config/*
!*/etc/psa_update/* !/opt/app/ATBAPP/*.ini
!*/etc/psa_tariff/* !/opt/app/sysconfig/*.ini
!*/etc/dc/*.hex !/opt/app/ISMASMgr/*.ini
!*/etc/dc/*.bin

View File

@@ -88,15 +88,13 @@ enable=1
[PAYMENT] [PAYMENT]
currencySymbol=Ft currencySymbol=
currencyISOCode=HUF
cashVariant=CoinsOnly cashVariant=CoinsOnly
paymentPointInTime=poa paymentPointInTime=poa
[MOBILISIS_CalculatePricePlugin] [MOBILISIS_CalculatePricePlugin]
useDebug=1 useDebug=1
tariffFileName=/etc/psa_tariff/tariff01.json
[ATBDeviceControllerPlugin] [ATBDeviceControllerPlugin]
serialPort=ttymxc2 serialPort=ttymxc2

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -1,38 +1,28 @@
{ {
"title":"DC2C_pri01", "title":"DC2C_pri01",
"project":"DBM Szeged park_coins", "project":"DBM Szeged",
"issued":"13.04.2023 01.02", "version":"13.02.2023 12:20 00001",
"styl":"font 08", "styl":"bold on",
"styl":"size 10", "text":"Parkingticket ",
"feed":"margin02", "styl":"bold off",
"feed":"rim02",
"text":"PARKOLÓJEGY",
"styl":"size 00",
"feed":"nl", "feed":"nl",
"text":" Nyugta", "text":"Parkingticket ",
"styl":"under on",
"text":"Parkingticket ",
"styl":"under off",
"feed":"nl", "feed":"nl",
"text":"Kérjük az elsö szélvédö", "text":"Parkingticket ",
"styl":"latin on",
"text":"Parkingticket ",
"styl":"latin off",
"feed":"nl", "feed":"nl",
"text":"mögé jól láthatóan", "text":"Parkingticket ",
"styl":"font 09",
"text":"Park ",
"styl":"font 16",
"text":"Park ",
"feed":"nl", "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",
} }

View File

@@ -1,37 +1,5 @@
{ {
"title":"DC2C_pri02", "title":"DC2C_pri02",
"project":"DBM Szeged park_coins", "version":"27.02.2023 12:20 00001",
"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",
} }

View File

@@ -1,22 +1,5 @@
{ {
"title":"DC2C_pri03", "title":"DC2C_pri03",
"project":"DBM Szeged park_coins", "version":"27.02.2023 12:20 00001",
"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",
} }

View File

@@ -1,8 +1,5 @@
{ {
"title":"DC2C_pri04", "title":"DC2C_pri04",
"project":"empty", "version":"27.02.2023 12:20 00001",
"issued":"24.05.2023 01.00", "":""
"text":""
} }

View File

@@ -1,5 +1,5 @@
{ {
"title":"DC2C_pri10", "title":"DC2C_pri10",
"version":"27.02.2023 12:20 00001", "version":"27.02.2023 12:20 00001",
"test":"" "":""
} }

View File

@@ -1,24 +1,5 @@
{ {
"title":"DC2C_pri29", "title":"DC2C_pri29",
"project":"ATB test", "version":"27.02.2023 12:20 00001",
"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",
} }

View File

@@ -1,39 +1,6 @@
{ {
"title":"DC2C_pri32", "title":"DC2C_pri32",
"project":"DBM Szeged door", "version":"27.02.2023 12:20 00001",
"issued":"18.04.2023 01.01", "":"",
"styl":"font 08", "":"10001"
"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",
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +0,0 @@
{
"test":"test"
}

View File

@@ -16,9 +16,12 @@
# --force-reinstall install ptu5-atb-apinfo # --force-reinstall install ptu5-atb-apinfo
# --force-reinstall install atbqt # --force-reinstall install atbqt
# update # update
opkg update opkg update
# opkg --noaction install atbqt opkg --noaction install atbqt
# opkg install atbqt opkg install atbqt
# #
# #
# #