fix perms
This commit is contained in:
parent
4d4d6d802c
commit
b576fd7c66
18
debian/postinst
vendored
18
debian/postinst
vendored
|
@ -28,9 +28,23 @@ if [ "$1" = configure ]; then
|
||||||
set -e
|
set -e
|
||||||
COLLECTIONS=true
|
COLLECTIONS=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -f /etc/crowdsec/local_api_credentials.yaml ]] ; then
|
||||||
|
chmod 600 /etc/crowdsec/local_api_credentials.yaml
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -f /etc/crowdsec/online_api_credentials.yaml ]]; then
|
||||||
|
chmod 600 /etc/crowdsec/online_api_credentials.yaml
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ! -f /etc/crowdsec/local_api_credentials.yaml ]] || [[ ! -f /etc/crowdsec/online_api_credentials.yaml ]]; then
|
if [[ ! -f /etc/crowdsec/local_api_credentials.yaml ]] || [[ ! -f /etc/crowdsec/online_api_credentials.yaml ]]; then
|
||||||
touch /etc/crowdsec/local_api_credentials.yaml
|
if [[ ! -f /etc/crowdsec/local_api_credentials.yaml ]] ; then
|
||||||
touch /etc/crowdsec/online_api_credentials.yaml
|
install -m 600 /dev/null /etc/crowdsec/local_api_credentials.yaml
|
||||||
|
fi
|
||||||
|
if [[ ! -f /etc/crowdsec/online_api_credentials.yaml ]] ; then
|
||||||
|
install -m 600 /dev/null /etc/crowdsec/online_api_credentials.yaml
|
||||||
|
fi
|
||||||
|
|
||||||
db_input medium crowdsec/lapi || true
|
db_input medium crowdsec/lapi || true
|
||||||
db_go || true
|
db_go || true
|
||||||
|
|
||||||
|
|
|
@ -155,8 +155,8 @@ if [ $1 == 1 ]; then
|
||||||
set +e
|
set +e
|
||||||
fi
|
fi
|
||||||
if [ ! -f "%{_sysconfdir}/crowdsec/online_api_credentials.yaml" ] && [ ! -f "%{_sysconfdir}/crowdsec/local_api_credentials.yaml" ] ; then
|
if [ ! -f "%{_sysconfdir}/crowdsec/online_api_credentials.yaml" ] && [ ! -f "%{_sysconfdir}/crowdsec/local_api_credentials.yaml" ] ; then
|
||||||
touch %{_sysconfdir}/crowdsec/online_api_credentials.yaml
|
install -m 600 /dev/null %{_sysconfdir}/crowdsec/online_api_credentials.yaml
|
||||||
touch %{_sysconfdir}/crowdsec/local_api_credentials.yaml
|
install -m 600 /dev/null %{_sysconfdir}/crowdsec/local_api_credentials.yaml
|
||||||
cscli capi register
|
cscli capi register
|
||||||
cscli machines add -a
|
cscli machines add -a
|
||||||
fi
|
fi
|
||||||
|
@ -180,6 +180,13 @@ elif [ $1 == 2 ] && [ -d /var/lib/crowdsec/backup ]; then
|
||||||
rm -rf /var/lib/crowdsec/backup
|
rm -rf /var/lib/crowdsec/backup
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -f %{_sysconfdir}/crowdsec/online_api_credentials.yaml ]] ; then
|
||||||
|
chmod 600 %{_sysconfdir}/crowdsec/online_api_credentials.yaml
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -f %{_sysconfdir}/crowdsec/local_api_credentials.yaml ]] ; then
|
||||||
|
chmod 600 %{_sysconfdir}/crowdsec/local_api_credentials.yaml
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%systemd_post %{name}.service
|
%systemd_post %{name}.service
|
||||||
|
|
Loading…
Reference in a new issue