#!/usr/bin/bash

# Ubuntu postinstall 
chmod 700 /usr/lib/cryptobone ;
chmod 700 /usr/lib/cryptobone/bin ;
chmod 700 /usr/lib/cryptobone/cryptobone ;
chmod 700 /usr/lib/cryptobone/cryptoboned ;
chmod 700 /usr/lib/cryptobone/keys ;
chmod 700 /usr/lib/cryptobone/ext ;
chmod 700 /usr/lib/cryptobone/cbcontrol ;
chmod 700 /usr/lib/cryptobone/cbcontrol.functions ;
chmod 700 /usr/lib/cryptobone/check* ;
chmod 700 /usr/lib/cryptobone/createmasterkey ;
chmod 700 /usr/lib/cryptobone/initdatabase ;
chmod 700 /usr/lib/cryptobone/get*;
chmod 700 /usr/lib/cryptobone/rc.local ;
chmod 700 /usr/lib/cryptobone/safewebdrop ;
chmod 700 /usr/lib/cryptobone/safewebdrop/bin/* ;
chmod 700 /usr/lib/cryptobone/systemd.fetch ;
chmod 700 /usr/lib/cryptobone/init.d ;
chmod 700 /usr/lib/cryptobone/init.d/cryptoboned ;
chmod 700 /usr/lib/cryptobone/ext/bin ;
chmod 700 /usr/lib/cryptobone/ext/cbcontrol ;
chmod 700 /usr/lib/cryptobone/ext/cbcontrol.functions ;
chmod 700 /usr/lib/cryptobone/ext/cryptoboneshell ;
chmod 700 /usr/lib/cryptobone/ext/cryptoboneexternd ;
chmod 700 /usr/lib/cryptobone/ext/firewall ;
chmod 700 /usr/lib/cryptobone/ext/initialkeysetup ;
chmod 700 /usr/lib/cryptobone/ext/destroy ;
chmod 700 /usr/lib/cryptobone/ext/rc.local ;
chmod 700 /usr/lib/cryptobone/ext/init.d ;
chmod 700 /usr/lib/cryptobone/ext/init.d/cryptoboneexternd ;

# restore the header if it exists
if [ -r /usr/lib/cryptobone/header.backup ] ; then
     /usr/bin/cp /usr/lib/cryptobone/header.backup /usr/lib/cryptobone/safewebdrop.header
fi


exit 0
