dbpath=$2
# extract smack label before removal
DB_LABEL=""
- if [ -f $dbpath.$name.db ]
- then
- DB_LABEL=`chsmack $dbpath.$name.db | sed -r "s/.*access=\"([^\"]+)\"/\1/"`
- fi
rm -f $dbpath.$name.db
-
# extract smack label before removal
JOURNAL_LABEL=""
- if [ -f $dbpath.$name.db-journal ]
- then
- JOURNAL_LABEL=`chsmack $dbpath.$name.db-journal | sed -r "s/.*access=\"([^\"]+)\"/\1/"`
- fi
rm -f $dbpath.$name.db-journal
SQL=".read /usr/share/wrt-engine/"$name"_db.sql"
pkill -9 security-serv
# restore smack label
- if [ -n "$DB_LABEL" ]
- then
- chsmack -a $DB_LABEL $dbpath.$name.db
- fi
-
# restore smack label
- if [ -n "$JOURNAL_LABEL" ]
- then
- chsmack -a $JOURNAL_LABEL $dbpath.$name.db-journal
- fi
}
for name in wrt
fi
# Set Smack label for db files
-chsmack -a 'wrt-commons::db_wrt' /opt/dbspace/.wrt.db
-chsmack -a 'wrt-commons::db_wrt' /opt/dbspace/.wrt.db-journal
-chsmack -a 'wrt-commons::db_wrt_custom_handler' /opt/usr/dbspace/.wrt_custom_handler.db
-chsmack -a 'wrt-commons::db_wrt_custom_handler' /opt/usr/dbspace/.wrt_custom_handler.db-journal
echo "[WRT] wrt-commons postinst done ..."