diff options
Diffstat (limited to 'owncloud-archive.install')
-rw-r--r-- | owncloud-archive.install | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/owncloud-archive.install b/owncloud-archive.install new file mode 100644 index 000000000000..0dedf944f5f5 --- /dev/null +++ b/owncloud-archive.install @@ -0,0 +1,47 @@ +# arg 1: the new package version +# arg 2: the old package version + +ocpath='/usr/share/webapps/owncloud' +htuser='http' +htgroup='http' +rootuser='root' + +fix_perms () { + printf "Creating possible missing Directories\n" + mkdir -p $ocpath/data + mkdir -p $ocpath/assets + + printf "chmod Files and Directories\n" + find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640 + find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750 + + printf "chown Directories\n" + chown -R ${rootuser}:${htgroup} ${ocpath}/ + chown -R ${htuser}:${htgroup} ${ocpath}/apps/ + chown -R ${htuser}:${htgroup} ${ocpath}/config/ + chown -R ${htuser}:${htgroup} ${ocpath}/data/ + chown -R ${htuser}:${htgroup} ${ocpath}/themes/ + chown -R ${htuser}:${htgroup} ${ocpath}/assets/ + + chmod +x ${ocpath}/occ + + printf "chmod/chown .htaccess\n" + if [ -f ${ocpath}/.htaccess ] + then + chmod 0644 ${ocpath}/.htaccess + chown ${rootuser}:${htgroup} ${ocpath}/.htaccess + fi + if [ -f ${ocpath}/data/.htaccess ] + then + chmod 0644 ${ocpath}/data/.htaccess + chown ${rootuser}:${htgroup} ${ocpath}/data/.htaccess + fi +} + +post_install () { + fix_perms +} + +post_upgrade() { + fix_perms +} |