Commit 7252765a authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

ors-amarisoft: fix handling the previous logs

parent bd52064c
......@@ -104,7 +104,7 @@ md5sum = dab992c02a363e00cdc86f102a7ae489
[template-ue]
_update_hash_filename_ = instance-ue.jinja2.cfg
md5sum = 7b9a49e6cab7d865c93148ec57d015ff
md5sum = eb4c1c0e654922ded618991e5f3c0f8f
[template-obsolete]
_update_hash_filename_ = instance-obsolete.jinja2.cfg
......
......@@ -62,14 +62,17 @@ log = ${:var}/log
recipe = slapos.recipe.template
output = ${directory:bin}/${:_buildout_section_name_}
ue-log = ${directory:log}/ue-output.log
ue-radio-log = ${directory:log}/ue.log
ue-start-date = ${directory:run}/enb-start.date
inline =
#!/bin/sh
{% if not slapparameter_dict.get("testing", False) %}
sudo /opt/amarisoft/rm-tmp-lte | true;
sudo -n /opt/amarisoft/init-sdr;
sudo -n /opt/amarisoft/init-ue;
stat ${:ue-log}/.ue-start-timestamp && mv ${:ue-log}/ue.log ${:ue-log}/ue-$(cat ${:ue-log}/.ue-start-timestamp).log
date +"%Y-%m-%d-%T" > ${:ue-log}/.ue-start-timestamp
stat ${:ue-start-date} && mv ${:ue-radio-log} ${directory:log}/ue-$(cat ${:ue-start-date}).log
rm -f $(ls -1t ${directory:log}/ue-2* | tail -n+50)
date +"%Y-%m-%d-%T" > ${:ue-start-date}
(echo && echo && date "+[%Y/%m/%d %T.%N %Z] Starting UE software..." && echo) >> ${:ue-log};
tail -c 1M ${:ue-log} > ${:ue-log}.tmp;
mv ${:ue-log}.tmp ${:ue-log};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment