diff --git a/plugins/available/base.plugin.bash b/plugins/available/base.plugin.bash index ee46b6c762..b9a1f4ca1d 100644 --- a/plugins/available/base.plugin.bash +++ b/plugins/available/base.plugin.bash @@ -16,10 +16,16 @@ function ips() { function down4me() { about 'checks whether a website is down for you, or everybody' - param '1: website url' + param '1: website url or domain' example '$ down4me http://www.google.com' + example '$ down4me google.com' group 'base' - curl -Ls "http://downforeveryoneorjustme.com/$1" | sed '/just you/!d;s/<[^>]*>//g' + # Strip protocol (http:// or https://) if present + local site="${1#http://}" + site="${site#https://}" + # Strip trailing slash if present + site="${site%/}" + command curl -Ls "http://downforeveryoneorjustme.com/${site}" | command sed '/just you/!d;s/<[^>]*>//g' } function myip() {