summaryrefslogtreecommitdiff
path: root/lib/gitlab_keys.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab_keys.rb')
-rw-r--r--lib/gitlab_keys.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/gitlab_keys.rb b/lib/gitlab_keys.rb
index 03026ed..d09360f 100644
--- a/lib/gitlab_keys.rb
+++ b/lib/gitlab_keys.rb
@@ -17,6 +17,7 @@ class GitlabKeys
case @command
when 'add-key'; add_key
when 'rm-key'; rm_key
+ when 'clear'; clear
else
$logger.warn "Attempt to execute invalid gitlab-keys command #{@command.inspect}."
puts 'not allowed'
@@ -38,4 +39,8 @@ class GitlabKeys
cmd = "sed -i '/shell #{@key_id}\"/d' #{auth_file}"
system(cmd)
end
+
+ def clear
+ system("echo '# Managed by gitlab-shell' > #{auth_file}")
+ end
end