您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #! /usr/bin/env bash
  2. export CONFIG_DIR="/etc/default/config-files/"
  3. replace_var()
  4. {
  5. file="${1}"
  6. var="${2}"
  7. sed -e "s?${var}?${!var}?g" -i "${file}"
  8. }
  9. replace_vars()
  10. {
  11. file="${1}"
  12. for var in $(cat /etc/vars-vars)
  13. do
  14. replace_var "${file}" "${var}"
  15. done
  16. }
  17. replace_files()
  18. {
  19. cat /etc/vars-files | while read line
  20. do
  21. filesrc="${CONFIG_DIR}$(echo "${line}" | awk '{print $1}')"
  22. filedst=$(echo "${line}" | awk '{print $2}')
  23. if [ -f "${filesrc}" ]
  24. then
  25. echo "Expanding file ${filesrc} to ${filedst}"
  26. cp "${filesrc}" "${filedst}"
  27. replace_vars "${filedst}"
  28. else
  29. echo "File ${filesrc} does not exist. Skipping."
  30. fi
  31. done
  32. }
  33. replace_files
  34. cd /var/www &&
  35. dotnet __RUN_ME.DLL
  36. sleep infinity