Add function to pull entire websites.
This commit is contained in:
@@ -1108,6 +1108,41 @@
|
|||||||
done
|
done
|
||||||
sh -c "rm '{{ notify_log_file_wip }}'"
|
sh -c "rm '{{ notify_log_file_wip }}'"
|
||||||
fi
|
fi
|
||||||
|
function_download_website: |
|
||||||
|
function download-website {
|
||||||
|
website="$1"
|
||||||
|
if [[ -z "$website" ]]; then
|
||||||
|
echo "ERROR: Website not provided. $website"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
if [[ "$website" != "http"* ]]; then
|
||||||
|
website="http://$website"
|
||||||
|
fi
|
||||||
|
wget --wait=2 \
|
||||||
|
--level=inf \
|
||||||
|
--limit-rate=20K \
|
||||||
|
--recursive \
|
||||||
|
--page-requisites \
|
||||||
|
--user-agent=Mozilla \
|
||||||
|
--no-parent \
|
||||||
|
--convert-links \
|
||||||
|
--adjust-extension \
|
||||||
|
--no-clobber \
|
||||||
|
-e robots=off \
|
||||||
|
$website &&
|
||||||
|
{
|
||||||
|
echo "Success!" ||
|
||||||
|
{
|
||||||
|
echo "ERROR: Command reported a failure. Please try again."
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
alias website-download="download-website"
|
||||||
|
alias curl-site="download-website"
|
||||||
|
alias pull-site="download-website"
|
||||||
|
alias curl-www="download-website"
|
||||||
|
alias pull-www="download-website"
|
||||||
|
alias www-pull="download-website"
|
||||||
|
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | Common Variable
|
- name: General | Account Management | Users | Files | Common Variable
|
||||||
@@ -1191,6 +1226,7 @@
|
|||||||
{{ alias_commit }}
|
{{ alias_commit }}
|
||||||
{{ function_loop }}
|
{{ function_loop }}
|
||||||
{{ process_notify_log }}
|
{{ process_notify_log }}
|
||||||
|
{{ function_download_website }}
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | .bashrc
|
- name: General | Account Management | Users | Files | .bashrc
|
||||||
blockinfile:
|
blockinfile:
|
||||||
|
|||||||
Reference in New Issue
Block a user