Advertisement
ciusss89

flight-plan.sh

Jun 24th, 2013
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.06 KB | None | 0 0
  1. #!/bin/bash
  2. #  script /usr/local/sbin/flight-plan.sh
  3. # TIPALDI GIUSEPPE 2-2013
  4.  
  5. # VAR;
  6. TIME=`/mnt/NAND/01_site/sys_state/FLYMODE | grep TIME | awk '{ print $2 }'`
  7. RUN="1";
  8. SD_FULL=`(echo "17000 * $TIME" | bc)`
  9. log_file="/mnt/NAND/01_site/sys_state/flight-plan-control-activity-log"
  10. freespace=`df /dev/mmcblk0p2 | grep mmcblk0p2 | awk '{ print $2 }'`
  11.  
  12. ##
  13. # Cpu:
  14. cpu-control.sh
  15.  
  16. ##
  17. # Clean ram
  18. cd /run/shm; rm -rf *; outpath="/mnt/sd/"
  19.  
  20. ##
  21. # Size of tmpfs
  22. Size=`df -h /run/shm | grep tmpfs | awk '{ print $2 }'`; echo "Size of tmpfs $Size"
  23.  
  24. ## VERIFICA FIMRWARE
  25. ##
  26. # Load new firmware in to gnss ram..
  27. gnss-flash.sh; sleep 5;
  28.  
  29. echo "Seconds collected [$TIME];"
  30.  
  31. while [ "$freespace" -ge "$SD_FULL" ]
  32. do
  33.    echo "ITERATIONS NUMBER $RUN"
  34.    gn3s -s $TIME;
  35.    nameC=`date +%Y-%m-%d-%H:%M:%S_row.bin`; nameB=`echo $RUN`; nameA=`md5sum test.bin | awk '{ print $1 }'`
  36.    name=`echo $nameA+$nameB+$nameC`; RUN=`(echo " 1 + $RUN" | bc)`
  37.    mv -v test.bin $outpath$name; sync
  38.    freespace=`df /dev/mmcblk0p2 | grep mmcblk0p2 | awk '{ print $2 }'`
  39.  
  40. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement