Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hsn=$(hostname);
- vdr=valid_dir "/home/files/Dropbox";
- if [ 0 eq $vdr ]; then
- echo "Valid Dir!";
- d_pth='/home/files/Dropbox/backups/${hsn}';
- else
- echo "Invalid Dir!";
- d_pth="/data/Backups/$hsn";
- fi
- function valid_dir {
- DIR="$1"
- if [ $# -lt 1 ]; then
- return 3;
- elif [ ! -d "$DIR" ]; then
- return 4;
- else
- return 0;
- fi
- } # end funcion valid_dir
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement