Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- yad --title="egPorSS - TYPO3 Constants Setup" --center --borders="20" --width="500" --separator="n" 2> /dev/null
- --form
- --field="egON API-Key":TEXT
- --field="Host for AJAX-Requests":TEXT
- --field="SOAP-Username":TEXT
- --field="SOAP-Password":TEXT
- --field="SOAP-URL:":TEXT
- --field="SEPA-Service":CHK
- --field="Base-Provider":CHK
- --field="Digital Signature":CHK
- --field="Company name":TEXT
- --field="Street, Number":TEXT
- --field="City":TEXT
- --button="Discard entries":1
- --button="Write to DB":0 > ./temp/constants_modified.txt # Write entries to .txt file.
- # if Button "Write to DB" is pressed, ask again, before manipulating DB
- if [ $? -eq 0 ]; then
- yad --title="egPorSS - TYPO3 Constants Setup" --center --borders="20" 2> /dev/null
- --text="Write changes to constants field in ${DB} now?"
- --button="No, discard":0
- --button="Yes, write":1
- # if "Yes, write" => modify ./temp/constants_${DB}.typoscript" and coll pushConstantsDB()
- if [ $? -eq 1 ]; then
- sed -i "s/plugin.tx_egon_pi1.system.apiKey.*/plugin.tx_egon_pi1.system.apiKey = ${modified[0]}/" ${typoscript}
- sed -i "s/plugin.tx_egon_pi1.system.host.*/plugin.tx_egon_pi1.system.host = ${modified[1]}/" ${typoscript}
- sed -i "s/plugin.tx_egon_pi1.soap.user.*/plugin.tx_egon_pi1.soap.user = ${modified[2]}/" ${typoscript}
- sed -i "s/plugin.tx_egon_pi1.soap.password.*/plugin.tx_egon_pi1.soap.password = ${modified[3]}/" ${typoscript}
- sed -i "s/plugin.tx_egon_pi1.soap.url.*/plugin.tx_egon_pi1.soap.url = ${modified[4]}/" ${typoscript}
- sed -i "s/plugin.tx_egon_pi1.settings.useSEPA.*/plugin.tx_egon_pi1.settings.useSEPA = ${modified[5]}/" ${typoscript}
- sed -i "s/plugin.tx_egon_pi1.settings.useBaseProvider.*/plugin.tx_egon_pi1.settings.useBaseProvider = ${modified[6]}/" ${typoscript}
- sed -i "s/plugin.tx_egon_pi1.settings.signatureAllowed.*/plugin.tx_egon_pi1.settings.signatureAllowed = ${modified[7]}/" ${typoscript}
- sed -i "s/plugin.tx_egon_pi1.custom.companyName.*/plugin.tx_egon_pi1.custom.companyName = ${modified[8]}/" ${typoscript}
- sed -i "s/plugin.tx_egon_pi1.custom.companyStreet.*/plugin.tx_egon_pi1.custom.companyStreet = ${modified[9]}/" ${typoscript}
- sed -i "s/plugin.tx_egon_pi1.custom.companyCity.*/plugin.tx_egon_pi1.custom.companyCity = ${modified[10]}/" ${typoscript}
- echo -e "${LIBLUE}Writing changes to Database now.. ${NF}n"
- pushConstantsDB
- else
- echo -e "${LIBLUE}Returning to main menu without any changes.. ${NF}"
- sleep 6
- fi
- else
- echo -e "${LIBLUE}Returning to main menu without any changes.. ${NF}"
- sleep 6
- fi
- #!/bin/bash
- input=$(yad --title="egPorSS - TYPO3 Constants Setup" --center --borders="20" --width="500" --separator="n" 2> /dev/null
- --form
- --field="egON API-Key":TEXT
- --field="Host for AJAX-Requests":TEXT
- --field="SOAP-Username":TEXT
- --field="SOAP-Password":H
- --field="SOAP-URL:":TEXT
- --field="SEPA-Service":CHK
- --field="Base-Provider":CHK
- --field="Digital Signature":CHK
- --field="Company name":TEXT
- --field="Street, Number":TEXT
- --field="City":TEXT
- --button="gtk-cancel:1"
- --button=" Update DB!iconok.png:2"
- 2>/dev/null
- );return_code=$?
- [[ "$return_code" -eq "2" ]] && { printf '%sn' "${input[*]}"| yad --text-info --width="400" --height="400" --title="New Data"
- --button="gtk-cancel:1"
- --button=" Update DB!iconok.png:2"
- 2>/dev/null
- };return_code=$?
- # See if "Update DB" was clicked
- [[ "$return_code" -eq "2" ]] && echo "Update DB was clicked" || echo "Cancel was clicked"
Add Comment
Please, Sign In to add comment