From ecc71d1172fe6f13d1fdaeef4bfc7b416d2a4b89 Mon Sep 17 00:00:00 2001 From: Santeri Kannisto Date: Sat, 2 Jun 2018 08:16:27 +0200 Subject: [PATCH] Fix for bug #1328 Added private bash function __urlencode to eliminate the php dependency which failed on godaddy due to multiple php instances and cron using the one without -r option. --- deploy/cpanel_uapi.sh | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/deploy/cpanel_uapi.sh b/deploy/cpanel_uapi.sh index 4563b9c4..8f588f79 100644 --- a/deploy/cpanel_uapi.sh +++ b/deploy/cpanel_uapi.sh @@ -2,11 +2,30 @@ # Here is the script to deploy the cert to your cpanel using the cpanel API. # Uses command line uapi. --user option is needed only if run as root. # Returns 0 when success. -# Written by Santeri Kannisto +# Written by Santeri Kannisto # Public domain, 2017 #export DEPLOY_CPANEL_USER=myusername +######## Private functions ##################### + +__urlencode() { + local string="${1}" + local strlen=${#string} + local encoded="" + local pos c o + + for (( pos=0 ; pos