Project

General

Profile

Feature #90

Updated by Igor Pashev over 11 years ago

Script @lib/svc/bin/restore_repository@ uses @lib/svc/bin/sqlite@ 
 to check repository integrity check. Obviously it requires require sqlite binary. 

 But since libsqlite is statically linked to @svc.configd@, 
 we could add integrity checking into @svc.configd@. 


 @lib/svc/bin/restore_repository@: 
 <pre> 
         if [ -f $file ]; then 
                 if [ -r $file ]; then 
                         checkresults="`echo PRAGMA integrity_check\; | \ 
                             /lib/svc/bin/sqlite $file >&1 | grep -v '^ok$'`" 

                         if [ -n "$checkresults" ]; then 
                                 echo "$file: integrity check failed:" >&2 
                                 echo "$checkresults" >&2 
                                 echo 
                         else 
                                 cont=true    
                         fi 
                 else 
                         echo "$file: not readable" 
                 fi 
         elif [ -n "$file" ]; then 
                 echo "$file: not found" 
         fi 

 </pre>

Back