make.sh 662 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash
  2. if [ "$1" == "" ]; then
  3. echo "Only building, not flashing. Add a tty port for flashing."
  4. else
  5. port="$1";
  6. fi
  7. echo "Uploading to the server.."
  8. command="curl http://imegumii.space:12001/upradio.php -w '\n' --progress-bar ";
  9. for i in *.c *.h; do
  10. command="$command -F \"file[]=@$i\"";
  11. done
  12. output=$(eval $command);
  13. echo "$output";
  14. if [ "$output" = "success" ]; then
  15. rm ipac.hex -f
  16. echo "Downloading hex file.."
  17. wget http://imegumii.space:12001/source/ipac.hex -q --show-progress;
  18. if [ "$port" != "" ]; then
  19. echo "Starting flash..";
  20. mono internetradioflash.exe f=ipac.hex p="$port"
  21. fi
  22. else
  23. echo "Errors when making; Stopped";
  24. fi