home
/
code
/
khome.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4ac0260
)
Accept a name for dl and include starter script file
master
author
Siraaj Khandkar
<siraaj@khandkar.net>
Wed, 26 Apr 2023 16:27:12 +0000
(12:27 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Wed, 26 Apr 2023 16:27:12 +0000
(12:27 -0400)
home/lib/login_functions.sh
patch
|
blob
|
blame
|
history
diff --git
a/home/lib/login_functions.sh
b/home/lib/login_functions.sh
index
4f62b82
..
56e0c2b
100644
(file)
--- a/
home/lib/login_functions.sh
+++ b/
home/lib/login_functions.sh
@@
-26,13
+26,30
@@
notify_done() {
fi
}
fi
}
+_dl_script() {
+cat << EOF
+#! /bin/bash
+wget -c \$(< ./url)
+EOF
+}
+
dl() {
dl() {
+ local -r name="$1"
+ local -r url="$2"
+
local -r timestamp="$(date --iso-8601=ns)"
local -r timestamp="$(date --iso-8601=ns)"
- local -r dir="$HOME"/dl/adhoc/"$timestamp"
+ local -r dir="$HOME"/dl/adhoc/"$timestamp"
--"$name"
local -r url_file_path="${dir}/url"
local -r url_file_path="${dir}/url"
+ local -r dl_file_path="${dir}/dl"
mkdir -p "$dir"
touch "$url_file_path"
mkdir -p "$dir"
touch "$url_file_path"
+ if [ "$url" != '' ]
+ then
+ echo "$url" > "$url_file_path"
+ fi
+ _dl_script > "$dl_file_path"
+ chmod +x "$dl_file_path"
cd "$dir"
}
cd "$dir"
}
This page took
0.03369 seconds
and
4
git commands to generate.