Added some convenience scripts

This commit is contained in:
Autumn Naber
2024-03-14 14:44:27 -07:00
parent 5a6d64d401
commit 67d73a4c71
3 changed files with 32 additions and 2 deletions

20
gentags Executable file
View File

@@ -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'"

View File

@@ -18,11 +18,17 @@ git submodule init
git submodule update --recursive git submodule update --recursive
echo "Copying configs" echo "Copying configs"
copy_list=(ctags dircolors gitconfig inputrc tmux.conf vim vimrc Xdefaults) config_copy_list=(ctags dircolors gitconfig inputrc tmux.conf vim vimrc Xdefaults)
for config in ${copy_list[@]}; do for config in ${config_copy_list[@]}; do
cp -fr "$config" $HOME/."$config" cp -fr "$config" $HOME/."$config"
done 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 "=========================================================="
echo "= Be sure to adjust the Git user/email as necessary!!!!! =" echo "= Be sure to adjust the Git user/email as necessary!!!!! ="
echo "==========================================================" echo "=========================================================="

4
update-dns.sh Executable file
View File

@@ -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