Advertisement
geofferey

terminal-backgrounder.sh

Jul 20th, 2013
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.51 KB | None | 0 0
  1. #Sets up terminal environment?
  2.  
  3. if [[ $TERM = network || -z $TERM ]]; then
  4.     export TERM=linux
  5. fi
  6.  
  7. # This script automatically runs screen & screen -r (resume) based on a set of conditions.
  8.  
  9. # Variable DIR (variable could be anything)
  10.  
  11. DIR="/tmp/screens/S-mobile"
  12.  
  13. # if /tmp/screens/S-mobile list files then run screen -x
  14.  
  15. if [ $(ls -A "$DIR") ]; then
  16.     screen -x
  17. fi
  18.  
  19. # if /tmp/screen/S-mobile contains X files = to 0 then run screen -q
  20.  
  21. if [ $(ls -A "$DIR" | wc -l) -eq 0 ]; then
  22.     screen -q
  23. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement