Skip to content

Commit

Permalink
Rename and hide md5 file
Browse files Browse the repository at this point in the history
  • Loading branch information
jasontedor committed Mar 7, 2018
1 parent 50c2a09 commit 336998e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion distribution/packages/src/common/scripts/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ if [ ! -f "$ES_PATH_CONF"/elasticsearch.keystore ]; then
/usr/share/elasticsearch/bin/elasticsearch-keystore create
chown root:elasticsearch "$ES_PATH_CONF"/elasticsearch.keystore
chmod 660 "$ES_PATH_CONF"/elasticsearch.keystore
md5sum "$ES_PATH_CONF"/elasticsearch.keystore > "$ES_PATH_CONF"/elasticsearch.keystore.md5sum
md5sum "$ES_PATH_CONF"/elasticsearch.keystore > "$ES_PATH_CONF"/.elasticsearch.keystore.initial_md5sum
fi

${scripts.footer}
4 changes: 2 additions & 2 deletions distribution/packages/src/common/scripts/prerm
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ if [ "$STOP_REQUIRED" = "true" ]; then
fi

if [ -f "$ES_PATH_CONF"/elasticsearch.keystore ]; then
if md5sum --status -c "$ES_PATH_CONF"/elasticsearch.keystore.md5sum; then
rm "$ES_PATH_CONF"/elasticsearch.keystore "$ES_PATH_CONF"/elasticsearch.keystore.md5sum
if md5sum --status -c "$ES_PATH_CONF"/.elasticsearch.keystore.initial_md5sum; then
rm "$ES_PATH_CONF"/elasticsearch.keystore "$ES_PATH_CONF"/.elasticsearch.keystore.initial_md5sum
fi
fi

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ setup() {
assert_file_exist "/etc/elasticsearch"
# TODO: use ucf to handle these better for Debian-based systems
assert_file_not_exist "/etc/elasticsearch/elasticsearch.keystore"
assert_file_not_exist "/etc/elasticsearch/elasticsearch.keystore.md5sum"
assert_file_not_exist "/etc/elasticsearch/.elasticsearch.keystore.initial_md5sum"
assert_file_exist "/etc/elasticsearch/elasticsearch.yml"
assert_file_exist "/etc/elasticsearch/jvm.options"
assert_file_exist "/etc/elasticsearch/log4j2.properties"
Expand All @@ -174,7 +174,7 @@ setup() {
# all remaining files are deleted by the purge
assert_file_not_exist "/etc/elasticsearch"
assert_file_not_exist "/etc/elasticsearch/elasticsearch.keystore"
assert_file_not_exist "/etc/elasticsearch/elasticsearch.keystore.md5sum"
assert_file_not_exist "/etc/elasticsearch/.elasticsearch.keystore.initial_md5sum"
assert_file_not_exist "/etc/elasticsearch/elasticsearch.yml"
assert_file_not_exist "/etc/elasticsearch/jvm.options"
assert_file_not_exist "/etc/elasticsearch/log4j2.properties"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ verify_package_installation() {

sudo -u elasticsearch "$ESHOME/bin/elasticsearch-keystore" list | grep "keystore.seed"

assert_file "$ESCONFIG/elasticsearch.keystore.md5sum" f root elasticsearch 644
assert_file "$ESCONFIG/.elasticsearch.keystore.initial_md5sum" f root elasticsearch 644
assert_file "$ESCONFIG/elasticsearch.yml" f root elasticsearch 660
assert_file "$ESCONFIG/jvm.options" f root elasticsearch 660
assert_file "$ESCONFIG/log4j2.properties" f root elasticsearch 660
Expand Down

0 comments on commit 336998e

Please sign in to comment.