Skip to content
Snippets Groups Projects
Verified Commit 4f06bb54 authored by David Beniamine's avatar David Beniamine
Browse files

Fix registry clean

parent 61c15ae1
No related branches found
No related tags found
No related merge requests found
...@@ -20,9 +20,10 @@ conf_dir="/etc/registry" ...@@ -20,9 +20,10 @@ conf_dir="/etc/registry"
conf_file="$conf_dir/hosts" conf_file="$conf_dir/hosts"
while read line while read line
do do
if [ "$(echo $line | cut -d ' ' -f 1)" -gt "$(date -d '-6 month' +%Y%m%d)" ] if [ ! -z "$line"] && \
[ "$(echo $line | cut -d ' ' -f 1)" -lt "$(date -d '-6 month' +%Y%m%d)" ]
then then
LINES="$LINES\n$(date +%Y%m%d) $(echo $line | cut -d ' ' -f 2-)" LINES="$LINES\n$line"
fi fi
done < $conf_file done < $conf_file
echo -e $LINES > $conf_file echo -e $LINES > $conf_file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment