check for file/dir DNE
This commit is contained in:
		
							parent
							
								
									6c5ea52c68
								
							
						
					
					
						commit
						1b3b151008
					
				| @ -131,9 +131,13 @@ while [ $# -gt 0 ]; do | |||||||
|         -5|--503) |         -5|--503) | ||||||
|             # FULL path to 503 file |             # FULL path to 503 file | ||||||
|             if [ -n "$2" ]; then |             if [ -n "$2" ]; then | ||||||
|  |                 if [ -f "$2" ]; then | ||||||
|                     err503Path="${2%/}" |                     err503Path="${2%/}" | ||||||
|                     err503File="${2##*/}" |                     err503File="${2##*/}" | ||||||
|                     shift |                     shift | ||||||
|  |                 else | ||||||
|  |                     badParam dne "$@" | ||||||
|  |                 fi | ||||||
|             else |             else | ||||||
|                 badParam empty "$@" |                 badParam empty "$@" | ||||||
|             fi |             fi | ||||||
| @ -141,8 +145,12 @@ while [ $# -gt 0 ]; do | |||||||
|         -w|--webroot) |         -w|--webroot) | ||||||
|             # path to webroot (copy 503) |             # path to webroot (copy 503) | ||||||
|             if [ -n "$2" ]; then |             if [ -n "$2" ]; then | ||||||
|  |                 if [ -f "$2" ]; then | ||||||
|                     webroot="${2%/}" |                     webroot="${2%/}" | ||||||
|                     shift |                     shift | ||||||
|  |                 else | ||||||
|  |                     badParam dne "$@" | ||||||
|  |                 fi | ||||||
|             else |             else | ||||||
|                 badParam empty "$@" |                 badParam empty "$@" | ||||||
|             fi |             fi | ||||||
| @ -150,8 +158,12 @@ while [ $# -gt 0 ]; do | |||||||
|         -p|--seaf|--seafdir) |         -p|--seaf|--seafdir) | ||||||
|             # path to seafile program directory |             # path to seafile program directory | ||||||
|             if [ -n "$2" ]; then |             if [ -n "$2" ]; then | ||||||
|  |                 if [ -d "$2" ]; then | ||||||
|                     seafDir="${2%/}" |                     seafDir="${2%/}" | ||||||
|                     shift |                     shift | ||||||
|  |                 else | ||||||
|  |                     badParam dne "$@" | ||||||
|  |                 fi | ||||||
|             else |             else | ||||||
|                 badParam empty "$@" |                 badParam empty "$@" | ||||||
|             fi |             fi | ||||||
| @ -159,8 +171,12 @@ while [ $# -gt 0 ]; do | |||||||
|         -d|--data|--datadir|--seafdata) |         -d|--data|--datadir|--seafdata) | ||||||
|             # path to seafile data directory |             # path to seafile data directory | ||||||
|             if [ -n "$2" ]; then |             if [ -n "$2" ]; then | ||||||
|  |                 if [ -d "$2" ]; then | ||||||
|                     seafData="${2%/}" |                     seafData="${2%/}" | ||||||
|                     shift |                     shift | ||||||
|  |                 else | ||||||
|  |                     badParam dne "$@" | ||||||
|  |                 fi | ||||||
|             else |             else | ||||||
|                 badParam empty "$@" |                 badParam empty "$@" | ||||||
|             fi |             fi | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user