Skip to content
Snippets Groups Projects
Commit 8716c8b4 authored by Lennard's avatar Lennard
Browse files

Update overriding of commits and add detection for size of bash.log

parent fc902810
Branches
No related tags found
No related merge requests found
Pipeline #783 passed
...@@ -23,15 +23,26 @@ if [ $? -eq 0 ]; then ...@@ -23,15 +23,26 @@ if [ $? -eq 0 ]; then
fi fi
echo -e "\nPython script ended" echo -e "\nPython script ended"
# Check if bash.log is becoming too large
linecount=$(wc -l < bash.log)
if [[ $linecount -ge 3000 ]] ; then
# delete the first linecount - 3000 lines
delete_lines=$(($linecount-3000))
sed -i "1,${delete_lines}d" bash.log
fi
git pull git pull
last_commit_name=$(git log -1 --pretty=%B | cat) last_commit_name=$(git log -1 --pretty=%B | cat)
if [[ $string == *"New data"* ]]; then if [[ $last_commit_name == "New data" ]]
then
# check if the last commit was "New data" # check if the last commit was "New data"
# if yes overwrite the commit # if yes overwrite the commit
git reset --soft HEAD~1 git reset --soft HEAD~1
fi fi
sudo shutdown +5761
git add . git add .
git commit -m "New data" && git push --force git commit -m "New data" && git push --force
\ No newline at end of file
"""Return the id of the arduino connected to the first serial port. id 0 is for Temperaturmessung, id 1 for DMSMessung """Return the id of the arduino connected to the first serial port. Id 1 is for DMSMessung, id 2 for Temperaturmessung.
""" """
import time import time
import serial import serial
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment