Commit 6cbce4d8 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

check-url: Add check-secure parameter to return success in case of code 401

parent dadcae27
wendelin_notebook arnau cedric.ln-erp5-cluster commit_tool cygwin-res-resstack dream eos erp5 erp5-cluster erp5-cluster-fix-zeo-resilient erp5-cluster-haproxy-sticky-cookie erp5-cluster-resilient erp5-cluster-scalability erp5-component erp5-postfix erp5-release erp5-rkm erp5-scikit erp5-z2.12 erp5_diff erp5_kernel_jupyter erp5tesnode frontend-monitor-slave-configuration gcc-4.7 grid-computing hexaglobe-watermarking-replicated html5-dev-sr improved-hello-world ipython ivan jupyter_kernel_image_fix jupyter_wendelin klaus-ebusiness-lotse kvm-cluster kvm-iaas master monitor new-frontend nginx-push-stream officejs_testrunner openstack palo postgres powerdns reafs/heads/ipython recipe-test request-recipe scikit-notmerge sitemon slapos slapos-master-cluster slapos_tutorial slaprunner slaprunner-paas systematic systematic-nginx tristan-erp5-cluster tristan-tmp webrunner.custom-personal zerovm-test vifib-20150203 vifib-20150130 vifib-20150123 vifib-20150116 vifib-20141222 slapos.core-1.0.0rc6-1 slapos.cookbook-0.102 slapos.cookbook-0.100 slapos.cookbook-0.99 slapos.cookbook-0.98 slapos.cookbook-0.97 slapos.cookbook-0.96 slapos.cookbook-0.95 slapos.cookbook-0.94 slapos.cookbook-0.93 slapos.cookbook-0.92 slapos.cookbook-0.91 slapos.cookbook-0.90 slapos.cookbook-0.89 slapos.cookbook-0.88 slapos.cookbook-0.87 slapos.cookbook-0.86 slapos.cookbook-0.85 slapos.cookbook-0.84.2 slapos.cookbook-0.84.1 slapos.cookbook-0.84 slapos.cookbook-0.83.1 slapos.cookbook-0.83 slapos.cookbook-0.82 slapos.cookbook-0.81 slapos.cookbook-0.80 slapos.cookbook-0.79 slapos.cookbook-0.78.5 slapos-legacy-flask-stack slapos-0.270 slapos-0.263 slapos-0.262 slapos-0.261 slapos-0.260 slapos-0.259.2 slapos-0.259.1 slapos-0.259 slapos-0.258 slapos-0.257 slapos-0.256 slapos-0.255 slapos-0.254 slapos-0.253.3 slapos-0.253.2 slapos-0.253.1 slapos-0.253 slapos-0.252.1 slapos-0.252 slapos-0.251 slapos-0.250.1 slapos-0.250 slapos-0.249.1 slapos-0.249 slapos-0.248.1 slapos-0.248 slapos-0.247 slapos-0.246 slapos-0.245 slapos-0.244 slapos-0.243 slapos-0.242 slapos-0.241 slapos-0.240.0 slapos-0.240 slapos-0.239 slapos-0.238 slapos-0.237 slapos-0.236 slapos-0.235 slapos-0.234 slapos-0.233 slapos-0.232 slapos-0.231 slapos-0.230 slapos-0.229 slapos-0.228 slapos-0.227 slapos-0.226 slapos-0.225 slapos-0.224 slapos-0.223.1 slapos-0.223 slapos-0.222 slapos-0.221 slapos-0.220 slapos-0.219 slapos-0.218.2 slapos-0.218.1 slapos-0.218 slapos-0.217 slapos-0.217-B1 slapos-0.216 slapos-0.215 slapos-0.214 slapos-0.213 slapos-0.212 slapos-0.211 slapos-0.210 slapos-0.209 slapos-0.208 slapos-0.207 slapos-0.206 slapos-0.205 slapos-0.204 slapos-0.203 slapos-0.202 slapos-0.201 slapos-0.200 slapos-0.199 slapos-0.199-hotfix-20140409 slapos-0.198 slapos-0.197 slapos-0.196 slapos-0.195 slapos-0.194-RC3 slapos-0.194-RC2 slapos-0.194-RC1 slapos-0.193 slapos-0.192 slapos-0.191 slapos-0.190 slapos-0.189 slapos-0.188 slapos-0.187 slapos-0.186 slapos-0.185 slapos-0.184 slapos-0.183 slapos-0.182 slapos-0.181 slapos-0.180 slapos-0.179 slapos-0.178 slapos-0.175 cygwin-resstack-3 cygwin-resstack-2
No related merge requests found
......@@ -37,6 +37,7 @@ class Recipe(GenericBaseRecipe):
'url': self.options['url'],
'shell_path': self.options['dash_path'],
'curl_path': self.options['curl_path'],
'check_secure': self.options.get('check-secure', 0)
}
# XXX-Cedric in this script, curl won't check certificate
......
......@@ -31,6 +31,13 @@ if [ $CODE -eq 000 ]; then
exit 1
fi
if [ %(check_secure)s -eq 1 ]; then
if [ $CODE -eq 401 ]; then
echo "$URL is protected (returned $CODE)." >&2
exit 0
fi
fi
if ! [ $CODE -eq 200 ]; then
echo "$URL is not available (returned $CODE)." >&2
exit 2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment