Guest User

Untitled

a guest
Oct 16th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.83 KB | None | 0 0
  1. yad --title="egPorSS - TYPO3 Constants Setup" --center --borders="20" --width="500" --separator="n" 2> /dev/null
  2. --form
  3. --field="egON API-Key":TEXT
  4. --field="Host for AJAX-Requests":TEXT
  5. --field="SOAP-Username":TEXT
  6. --field="SOAP-Password":TEXT
  7. --field="SOAP-URL:":TEXT
  8. --field="SEPA-Service":CHK
  9. --field="Base-Provider":CHK
  10. --field="Digital Signature":CHK
  11. --field="Company name":TEXT
  12. --field="Street, Number":TEXT
  13. --field="City":TEXT
  14. --button="Discard entries":1
  15. --button="Write to DB":0 > ./temp/constants_modified.txt # Write entries to .txt file.
  16.  
  17. # if Button "Write to DB" is pressed, ask again, before manipulating DB
  18. if [ $? -eq 0 ]; then
  19. yad --title="egPorSS - TYPO3 Constants Setup" --center --borders="20" 2> /dev/null
  20. --text="Write changes to constants field in ${DB} now?"
  21. --button="No, discard":0
  22. --button="Yes, write":1
  23. # if "Yes, write" => modify ./temp/constants_${DB}.typoscript" and coll pushConstantsDB()
  24. if [ $? -eq 1 ]; then
  25. sed -i "s/plugin.tx_egon_pi1.system.apiKey.*/plugin.tx_egon_pi1.system.apiKey = ${modified[0]}/" ${typoscript}
  26. sed -i "s/plugin.tx_egon_pi1.system.host.*/plugin.tx_egon_pi1.system.host = ${modified[1]}/" ${typoscript}
  27. sed -i "s/plugin.tx_egon_pi1.soap.user.*/plugin.tx_egon_pi1.soap.user = ${modified[2]}/" ${typoscript}
  28. sed -i "s/plugin.tx_egon_pi1.soap.password.*/plugin.tx_egon_pi1.soap.password = ${modified[3]}/" ${typoscript}
  29. sed -i "s/plugin.tx_egon_pi1.soap.url.*/plugin.tx_egon_pi1.soap.url = ${modified[4]}/" ${typoscript}
  30. sed -i "s/plugin.tx_egon_pi1.settings.useSEPA.*/plugin.tx_egon_pi1.settings.useSEPA = ${modified[5]}/" ${typoscript}
  31. sed -i "s/plugin.tx_egon_pi1.settings.useBaseProvider.*/plugin.tx_egon_pi1.settings.useBaseProvider = ${modified[6]}/" ${typoscript}
  32. sed -i "s/plugin.tx_egon_pi1.settings.signatureAllowed.*/plugin.tx_egon_pi1.settings.signatureAllowed = ${modified[7]}/" ${typoscript}
  33. sed -i "s/plugin.tx_egon_pi1.custom.companyName.*/plugin.tx_egon_pi1.custom.companyName = ${modified[8]}/" ${typoscript}
  34. sed -i "s/plugin.tx_egon_pi1.custom.companyStreet.*/plugin.tx_egon_pi1.custom.companyStreet = ${modified[9]}/" ${typoscript}
  35. sed -i "s/plugin.tx_egon_pi1.custom.companyCity.*/plugin.tx_egon_pi1.custom.companyCity = ${modified[10]}/" ${typoscript}
  36. echo -e "${LIBLUE}Writing changes to Database now.. ${NF}n"
  37. pushConstantsDB
  38. else
  39. echo -e "${LIBLUE}Returning to main menu without any changes.. ${NF}"
  40. sleep 6
  41. fi
  42. else
  43. echo -e "${LIBLUE}Returning to main menu without any changes.. ${NF}"
  44. sleep 6
  45. fi
  46.  
  47. #!/bin/bash
  48. input=$(yad --title="egPorSS - TYPO3 Constants Setup" --center --borders="20" --width="500" --separator="n" 2> /dev/null
  49. --form
  50. --field="egON API-Key":TEXT
  51. --field="Host for AJAX-Requests":TEXT
  52. --field="SOAP-Username":TEXT
  53. --field="SOAP-Password":H
  54. --field="SOAP-URL:":TEXT
  55. --field="SEPA-Service":CHK
  56. --field="Base-Provider":CHK
  57. --field="Digital Signature":CHK
  58. --field="Company name":TEXT
  59. --field="Street, Number":TEXT
  60. --field="City":TEXT
  61. --button="gtk-cancel:1"
  62. --button=" Update DB!iconok.png:2"
  63. 2>/dev/null
  64. );return_code=$?
  65.  
  66. [[ "$return_code" -eq "2" ]] && { printf '%sn' "${input[*]}"| yad --text-info --width="400" --height="400" --title="New Data"
  67. --button="gtk-cancel:1"
  68. --button=" Update DB!iconok.png:2"
  69. 2>/dev/null
  70. };return_code=$?
  71. # See if "Update DB" was clicked
  72. [[ "$return_code" -eq "2" ]] && echo "Update DB was clicked" || echo "Cancel was clicked"
Add Comment
Please, Sign In to add comment