summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2014-04-13 21:34:00 +0200
committerFlorian Pritz <bluewind@xinu.at>2014-04-13 21:34:00 +0200
commit1456f418b2d6404734ef902f9f67b94a73012aa2 (patch)
tree1367cfb65802047bbc3b6a910f34346638231d07
parent11e1b81e8d109d753673e91c38eecc6351946cd8 (diff)
downloadbin-1456f418b2d6404734ef902f9f67b94a73012aa2.tar.gz
bin-1456f418b2d6404734ef902f9f67b94a73012aa2.tar.xz
init_new_user.sh: support hosts without git
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xinit_new_user.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/init_new_user.sh b/init_new_user.sh
index a2333be..a8463c4 100755
--- a/init_new_user.sh
+++ b/init_new_user.sh
@@ -6,18 +6,22 @@ cd $HOME
mkdir -p git
clone_repo() {
- repo_url=$1
+ repo=$1
dest_dir=$2
if [[ -e $dest_dir ]]; then
return 0
fi
- git clone "$repo_url" "$dest_dir"
+ if type git &>/dev/null; then
+ git clone "git://git.server-speed.net/users/flo/$repo" "$dest_dir"
+ else
+ wget https://git.server-speed.net/users/flo/$repo/snapshot/master.tar.gz -O - | tar -C "$dest_dir" --strip-components 1 -xzf -
+ fi
}
-clone_repo git://git.server-speed.net/users/flo/bin bin
-clone_repo git://git.server-speed.net/users/flo/dotfiles git/dotfiles
+clone_repo bin bin
+clone_repo dotfiles git/dotfiles
mkdir -p .config/htop