diff --git a/gentags b/gentags new file mode 100755 index 0000000..0009239 --- /dev/null +++ b/gentags @@ -0,0 +1,20 @@ +#!/bin/bash + +CSCOPE_DIR="$PWD/cscope" + +if [ ! -d "$CSCOPE_DIR" ]; then + mkdir "$CSCOPE_DIR" +fi + +echo "Finding files ..." +find "$PWD" -type d \( -name regs -o -name reg \) -prune \ + -o -name '*.[ch]' \ + -o -name '*.cpp' \ + -o -name '*.cc' \ + -o -name '*.hpp' > "$CSCOPE_DIR/cscope.files" + +echo "Adding files to cscope db: $PWD/cscope.db ..." +cscope -b -i "$CSCOPE_DIR/cscope.files" + +export CSCOPE_DB="$PWD/cscope.out" +echo "Exported CSCOPE_DB to: '$CSCOPE_DB'" diff --git a/setup.sh b/setup.sh index d4ed901..160c03d 100755 --- a/setup.sh +++ b/setup.sh @@ -18,11 +18,17 @@ git submodule init git submodule update --recursive echo "Copying configs" -copy_list=(ctags dircolors gitconfig inputrc tmux.conf vim vimrc Xdefaults) -for config in ${copy_list[@]}; do +config_copy_list=(ctags dircolors gitconfig inputrc tmux.conf vim vimrc Xdefaults) +for config in ${config_copy_list[@]}; do cp -fr "$config" $HOME/."$config" done +echo "Copying scripts" +script_copy_list=(update-dns.sh gentags) +for script in ${script_copy_list[@]}; do + cp -fr "script" /usr/local/bin/$script +done + echo "==========================================================" echo "= Be sure to adjust the Git user/email as necessary!!!!! =" echo "==========================================================" diff --git a/update-dns.sh b/update-dns.sh new file mode 100755 index 0000000..b96770f --- /dev/null +++ b/update-dns.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +dns=$(nslookup.exe www.google.com 2>&1 | grep "Address:" | awk '{print $2}' | tr -d '\r') +printf "nameserver %s\n" "$dns" | tee /etc/resolv.conf