6 Commits

19 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'
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
# 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")
}
write_log_file () {
local now=$(date +"%Y-%m-%dT%T")
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
# add '/' prefix
echo "DOWNLOAD, $(echo $fn | awk '{ printf "/"$0 }'), $now, N/A" >> "$GIT_UPDATE_LOG"
for fn in $(git diff-tree -r HEAD@{1} HEAD --name-only); do
if grep -E -q "(DC.*json|dc.*hex|dc.*bin|tariff.*json)" <<< $fn; then
# called in repository: $fn is e.g. etc/psa_tariff/tariff01.json
# add '/' prefix
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
if grep -qE ".*opkg_commands" <<< $fn; then
readarray opkg_commands < <(cat $fn)
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
done
}
write_log_file
fi
if grep -E -q ".*opkg_commands" <<< $fn; then
readarray opkg_commands < <(cat $fn)
for opkg_c in "${opkg_commands[@]}"; do
test -z $opkg_c && continue;
test ! -z $(grep -E "^\s*[#]+.*$" <<< $opkg_c) && continue
echo -n "$opkg_c" | tr -d '\n\r' >> $OPKG_CMDS_TMP 2>&1
echo "" >> $OPKG_CMDS_TMP 2>&1
done
source "$fn"
fi
done

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
!etc/atb/*
!etc/psa_config/*
!etc/psa_update/*
!etc/psa_tariff/*
!etc/dc/*.hex
!etc/dc/*.bin
!*/etc/*.ini
!*/etc/atb/*
!*/etc/psa_config/*
!*/etc/psa_update/*
!*/etc/psa_tariff/*
!*/etc/dc/*.hex
!*/etc/dc/*.bin
!**/.gitignore
!**/.githooks/post-merge
!/etc/*.ini
!/etc/atb/*.ini
!/etc/psa_config/*
!/etc/psa_update/*
!/etc/psa_tariff/*
!/etc/dc/dc2c.hex
!/opt/app/ATBAPP/*.ini
!/opt/app/sysconfig/*.ini
!/opt/app/ISMASMgr/*.ini

View File

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

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",
"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",
"project":"DBM Szeged",
"version":"13.02.2023 12:20 00001",
"styl":"bold on",
"text":"Parkingticket ",
"styl":"bold off",
"feed":"nl",
"text":" Nyugta",
"text":"Parkingticket ",
"styl":"under on",
"text":"Parkingticket ",
"styl":"under off",
"feed":"nl",
"text":"Kérjük az elsö szélvédö",
"text":"Parkingticket ",
"styl":"latin on",
"text":"Parkingticket ",
"styl":"latin off",
"feed":"nl",
"text":"mögé jól láthatóan",
"text":"Parkingticket ",
"styl":"font 09",
"text":"Park ",
"styl":"font 16",
"text":"Park ",
"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",
"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",
}
{
"title":"DC2C_pri02",
"version":"27.02.2023 12:20 00001",
"":""
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,39 +1,6 @@
{
"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",
}
{
"title":"DC2C_pri32",
"version":"27.02.2023 12:20 00001",
"":"",
"":"10001"
}

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 atbqt
# update
opkg update
# opkg --noaction install atbqt
# opkg install atbqt
opkg --noaction install atbqt
opkg install atbqt
#
#
#