-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmovein_hidden.sh
More file actions
executable file
·69 lines (59 loc) · 1.39 KB
/
movein_hidden.sh
File metadata and controls
executable file
·69 lines (59 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# This is a script to assist with setting up a new Linux computer. It
# attempts to copy backed up files.
# !!!!!!!!!!!!!!!!! THIS SCRIPT IS NOT TESTED !!!!!!!!!!!!!!!!!!
# This is just a starter, for next time. - RBB 2013-10-11
source movein_conf.sh
src="$movein_home_src"
dst="$HOME"
usage() {
echo "Usage: $0 [-s src [-d dest] [-n] [-v] [-h]"
echo " -s src default = $src"
echo " -d dest default = $dst"
echo " -n dry run"
echo " -v verbose"
echo " -h print this help message"
exit 1
}
dryrun=""
verbose=""
while getopts ":s:d:hnv" o; do
case "${o}" in
s)
src=${OPTARG}
;;
d)
dst=${OPTARG}
;;
n)
dryrun="-n"
;;
v)
verbose="-v"
;;
*) # Note: this covers -h as well
usage
;;
esac
done
shift $((OPTIND-1))
cp_home_target () {
name=$1
if [ ! -e "$dst/$name" ]; then
if [ ! -z $verbose ]; then
echo "Copying $src/$name to $dst"
fi
if [ -z $dryrun ]; then
cp -apr "$src/$name" "$dst/"
fi
fi
}
if [ -d "$src" ]; then
cp_home_target ".ssh"
cp_home_target ".gitconfig"
cp_home_target ".bash_history"
cp_home_target ".pylintrc"
cp_home_target ".python_history"
#cp_home_target ".viminfo"
cp_home_target ".minirc.dfl"
fi