From f7f5548b33248a9d92d80e96617f964c4d76f48a Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 3 Aug 2012 16:02:48 +0900 Subject: [PATCH] add setup.sh correctly --- setup.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 setup.sh diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..6e21709 --- /dev/null +++ b/setup.sh @@ -0,0 +1,31 @@ +mkdir -p ~/.my/log +mkdir -p ~/.local/bin + +_my_install_script(){ + local dir="$HOME/.local/bin" + mkdir -p "$dir" + for f in "$@" + do + bn=$(basename "$f") + type $bn >/dev/null 2>&1 || { + if type wget >/dev/null 2>&1 + then + wget "$f" -P "$dir/" && + chmod u+x "${dir}/${bn}" + elif type curl >/dev/null 2>&1 + then + curl --url "$f" --output "${dir}/${bn}" && + chmod u+x "${dir}/${bn}" + fi + } + done +} +_my_install_script http://www.frexx.de/xterm-256-notes/data/colortable16.sh http://www.frexx.de/xterm-256-notes/data/256colors2.pl + +_my_install_symlink_script(){ + mkdir -p "$HOME/.local/bin/" + for f in "$@" + do + ln -s "$PWD/$f" "$HOME/.local/bin/" + done +}