1
0
forked from extern/zsync
zsync/bashclub-zsync/DEBIAN/postinst
2024-08-14 11:46:57 +00:00

25 lines
635 B
Bash
Executable File

#!/bin/bash
PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
# ensure log folder is present
if [ ! -d /var/log/bashclub-zsync ]; then
mkdir -p /var/log/bashclub-zsync
chown -R root:root /var/log/bashclub-zsync
chmod -R 755 /var/log/bashclub-zsync
fi
chown root:root /usr/bin/bashclub-zsync
chmod 755 /usr/bin/bashclub-zsync
if [ -f /etc/logrotate.d/bashclub_zsync ]; then
rm -f /etc/logrotate.d/bashclub_zsync
fi
if [ -f /etc/bashclub/zsync.conf ]; then
mv /etc/bashclub/zsync.conf.backup_$(date +%Y-%m-%d)
fi
chown root:root /etc/logrotate.d/bashclub-zsync
chmod 644 /etc/logrotate.d/bashclub-zsync