mirror of
https://github.com/JanJastrow/.dotfiles.git
synced 2024-11-25 11:52:51 +01:00
Compare commits
No commits in common. "a4448c29a3235e997946e31349fe97e0a19537be" and "f862086bee1137f56477792e68dd83c05a65f47e" have entirely different histories.
a4448c29a3
...
f862086bee
15
zsh/scripts
15
zsh/scripts
@ -99,19 +99,6 @@ function extract () {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Download provided url to $HOME/Downloads
|
|
||||||
function dl() {
|
|
||||||
if [ -z "$1" ]; then
|
|
||||||
echo "usage: dl url (directory)"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
if [[ -x $(which aria2) ]]; then
|
|
||||||
aria2c --dir="$HOME/Downloads" --continue=true --max-connection-per-server=5 "$1"
|
|
||||||
else
|
|
||||||
(cd "$HOME/Downloads" && curl -O "$1")
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Monitor IP/Host and report with Pushover
|
# Monitor IP/Host and report with Pushover
|
||||||
pnotify-online() {
|
pnotify-online() {
|
||||||
local ip_address="$1"
|
local ip_address="$1"
|
||||||
@ -119,7 +106,6 @@ pnotify-online() {
|
|||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
if ping -c 1 -W 1 "$ip_address" >/dev/null; then
|
if ping -c 1 -W 1 "$ip_address" >/dev/null; then
|
||||||
echo -e "\07*Ding*"
|
|
||||||
echo "$1 is online now."
|
echo "$1 is online now."
|
||||||
pushover "$1 is online now."
|
pushover "$1 is online now."
|
||||||
break
|
break
|
||||||
@ -133,7 +119,6 @@ pnotify-offline() {
|
|||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
if ! ping -c 1 -W 1 "$ip_address" >/dev/null; then
|
if ! ping -c 1 -W 1 "$ip_address" >/dev/null; then
|
||||||
echo -e "\07*Ding*"
|
|
||||||
echo "$1 is offline now."
|
echo "$1 is offline now."
|
||||||
pushover "$1 is offline now."
|
pushover "$1 is offline now."
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user