X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=changer-src%2Fchg-multi.sh;h=19ffb4122b2e3116988446e12eb25176c3b50cdd;hb=refs%2Ftags%2Fupstream%2F2.6.1;hp=ddb5301698c7515e500e5453c3993493b5a49913;hpb=fb2bd066c2f8b34addafe48d62550e3033a59431;p=debian%2Famanda diff --git a/changer-src/chg-multi.sh b/changer-src/chg-multi.sh index ddb5301..19ffb41 100644 --- a/changer-src/chg-multi.sh +++ b/changer-src/chg-multi.sh @@ -125,6 +125,42 @@ if [ -z "$ourstate" ]; then exit 2 fi +if [ -f "$ourstate" -a ! -r "$ourstate" ]; then + answer=`_ " %s: Can't read the statefile %s" "$pname" "$ourstate"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 +fi + +if [ -f "$ourstate" -a ! -w "$ourstate" ]; then + answer=`_ " %s: Can't write the statefile %s" "$pname" "$ourstate"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 +fi + +dirstate=`dirname $ourstate` +if [ ! -e "$dirstate" ]; then + answer=`_ " %s: Directory %s doesn't exist" "$pname" "$dirstate"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 +fi + +if [ ! -d "$dirstate" ]; then + answer=`_ ' %s: %s must be a directory' "$pname" "$dirstate"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 +fi + +if [ ! -w "$dirstate" ]; then + answer=`_ " %s: Can't write to %s directory" "$pname" "$dirstate"` + echo `_ 'Exit ->'` $answer >> $logfile + echo $answer + exit 2 +fi + # needeject and multieject are incompatible if [ $needeject -eq 1 ] && [ $multieject -eq 1 ] ; then answer=`_ ' %s: needeject and multieject cannot be both enabled in %s' "$pname" "$ourconf"` @@ -405,7 +441,7 @@ echo curloaded $curloaded >> $ourstate # return slot info if [ $slotempty -eq 1 ]; then - answer=`_ '%s %s: slot is empty' "$newslot" "$pname"` + answer=`_ '%s %s: slot is empty: %s' "$newslot" "$pname" "$amdevcheck_message"` echo `_ 'Exit ->'` $answer >> $logfile echo $answer exit 1