Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pirms 4 gadiem
pirms 4 gadiem
pirms 4 gadiem
pirms 4 gadiem
pirms 4 gadiem
pirms 4 gadiem
pirms 4 gadiem
pirms 4 gadiem
pirms 4 gadiem
pirms 4 gadiem
pirms 4 gadiem
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/bin/bash
  2. ## debug
  3. # set -x
  4. . "$HOME/.noaa.conf"
  5. declare -A levels=([DEBUG]=0 [INFO]=1 [WARN]=2 [ERROR]=3)
  6. log_level=${LOG_LEVEL}
  7. ## log function
  8. log() {
  9. local log_message=$1
  10. local log_priority=$2
  11. #check if level exists
  12. [[ ${levels[$log_priority]} ]] || return 1
  13. #check if level is enough
  14. (( ${levels[$log_priority]} < ${levels[$log_level]} )) && return 2
  15. #log here
  16. echo "${log_priority} : ${log_message}"
  17. }
  18. ## current date and folder structure
  19. START_DATE=$(date '+%d-%m-%Y %H:%M')
  20. FOLDER_DATE="$(date +%Y)/$(date +%m)/$(date +%d)"
  21. ## sane checks
  22. if [ ! -d "${NOAA_HOME}" ]; then
  23. mkdir -m 775 -p "${NOAA_HOME}"
  24. fi
  25. if [ ! -d "${NOAA_OUTPUT}/audio/" ]; then
  26. mkdir -m 775 -p "${NOAA_OUTPUT}/audio/"
  27. fi
  28. if [ ! -d "${METEOR_OUTPUT}" ]; then
  29. mkdir -m 775 -p "${METEOR_OUTPUT}"
  30. fi
  31. if [ ! -d "${METEOR_OUTPUT}/audio/" ]; then
  32. mkdir -m 775 -p "${METEOR_OUTPUT}/audio/"
  33. fi
  34. if [ ! -d "${RAMFS_AUDIO}/audio/" ]; then
  35. mkdir -m 775 -p "${RAMFS_AUDIO}/audio/"
  36. fi
  37. if [ ! -d "${NOAA_OUTPUT}/image/" ]; then
  38. mkdir -m 775 -p "${NOAA_OUTPUT}/image/"
  39. fi
  40. if [ ! -d "${NOAA_HOME}/map/" ]; then
  41. mkdir -m 775 -p "${NOAA_HOME}/map/"
  42. fi
  43. if [ ! -d "${NOAA_HOME}/predict/" ]; then
  44. mkdir -m 775 -p "${NOAA_HOME}/predict/"
  45. fi
  46. if [ ! -d "${NOAA_OUTPUT}/image/${FOLDER_DATE}" ]; then
  47. mkdir -m 775 -p "${NOAA_OUTPUT}/image/${FOLDER_DATE}"
  48. fi