fix and simplify rpm post installation script
This commit is contained in:
parent
9fb31b613d
commit
b59fb8ef43
1 changed files with 1 additions and 11 deletions
|
@ -167,21 +167,11 @@ if [ $1 == 1 ]; then
|
||||||
SILENT=true TMP_ACQUIS_FILE_SKIP=skip genacquisition
|
SILENT=true TMP_ACQUIS_FILE_SKIP=skip genacquisition
|
||||||
set +e
|
set +e
|
||||||
fi
|
fi
|
||||||
if [ ! -f "%{_sysconfdir}/crowdsec/online_api_credentials.yaml" ] && [ ! -f "%{_sysconfdir}/crowdsec/local_api_credentials.yaml" ] ; then
|
|
||||||
install -m 600 /dev/null %{_sysconfdir}/crowdsec/online_api_credentials.yaml
|
|
||||||
install -m 600 /dev/null %{_sysconfdir}/crowdsec/local_api_credentials.yaml
|
|
||||||
cscli capi register
|
|
||||||
[ -s "%{_sysconfdir}/crowdsec/local_api_credentials.yaml" ] || cscli machines add -a --force
|
|
||||||
fi
|
|
||||||
if [ ! -f "%{_sysconfdir}/crowdsec/online_api_credentials.yaml" ] ; then
|
if [ ! -f "%{_sysconfdir}/crowdsec/online_api_credentials.yaml" ] ; then
|
||||||
touch %{_sysconfdir}/crowdsec/online_api_credentials.yaml
|
|
||||||
chmod 600 %{_sysconfdir}/crowdsec/online_api_credentials.yaml
|
|
||||||
cscli capi register
|
cscli capi register
|
||||||
fi
|
fi
|
||||||
if [ ! -f "%{_sysconfdir}/crowdsec/local_api_credentials.yaml" ] ; then
|
if [ ! -f "%{_sysconfdir}/crowdsec/local_api_credentials.yaml" ] ; then
|
||||||
touch %{_sysconfdir}/crowdsec/local_api_credentials.yaml
|
cscli machines add -a
|
||||||
chmod 600 %{_sysconfdir}/crowdsec/local_api_credentials.yaml
|
|
||||||
[ -s "%{_sysconfdir}/crowdsec/local_api_credentials.yaml" ] || cscli machines add -a --force
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cscli hub update
|
cscli hub update
|
||||||
|
|
Loading…
Add table
Reference in a new issue