Newer
Older
DirtyScripts / search_dump.sh
  1. #!/bin/bash
  2. TERM=$1
  3. RNDNO=$RANDOM
  4. CURRDIR=$PWD
  5.  
  6. if [[ $# -eq 0 ]] ; then
  7. echo 'Usage: ./search_dump.sh <search term>'
  8. exit 1
  9. fi
  10.  
  11. echo Current: $CURRDIR
  12. echo Creating: /mnt/$RNDNO
  13. mkdir /mnt/$RNDNO
  14.  
  15. echo Mounting NAS
  16. mount -t cifs //192.168.0.13/NAS /mnt/$RNDNO -o username=nanoymaster,password=***REMOVED***,vers=1.0
  17. cd /mnt/$RNDNO/DB_Dumps/bigDB
  18.  
  19. echo Searching for $TERM in $PWD \(Est. 1hr\)...
  20. rg "$TERM"
  21.  
  22. echo Unmounting and removing: /mnt/$RNDNO
  23. cd $CURRDIR
  24. umount /mnt/$RNDNO
  25. rmdir /mnt/$RNDNO
Buy Me A Coffee