File: gitlab-keys

package info (click to toggle)
gitlab-shell 8.4.3%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,468 kB
  • sloc: ruby: 3,812; sh: 82; makefile: 60
file content (28 lines) | stat: -rwxr-xr-x 564 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env ruby

$:.unshift File.expand_path('../lib', __FILE__)
require 'gitlab_init'

#
# GitLab Keys shell. Add/remove keys from ~/.ssh/authorized_keys
#
# Ex.
#   /bin/gitlab-keys add-key key-782 "ssh-rsa AAAAx321..."
#
#   printf "key-782\tssh-rsa AAAAx321...\n" | /bin/gitlab-keys batch-add-keys
#
#   /bin/gitlab-keys rm-key key-23 "ssh-rsa AAAAx321..."
#
#   /bin/gitlab-keys list-keys
#   
#   /bin/gitlab-keys clear
#

require 'gitlab_keys'

# Return non-zero if command execution was not successful
if GitlabKeys.new.exec
  exit 0
else
  exit 1
end