Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffda-ssh-manager: rename separator variable and function #124

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ffda-ssh-manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ If you omit default settings from your `site.conf`, ssh-manager will automatical
selected.


## Append behvaior
## Append behavior

In case a key is defined in multiple activated groups, the key will only be appended once to `authorized_keys`.

Expand Down
10 changes: 5 additions & 5 deletions ffda-ssh-manager/luasrc/lib/gluon/upgrade/860-ffda-ssh-manager
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local uci = require('simple-uci').cursor()
local site = require('gluon.site')

local dropbear_key_path = '/etc/dropbear/authorized_keys'
local ssh_manager_seperator = '# Begin managed keys'
local ssh_manager_separator = '# Begin managed keys'
local ssh_manager_key_trailer = ' # managed key'

local uci_package = 'ffda-ssh-manager'
Expand All @@ -17,8 +17,8 @@ local function line_is_trailed_key(line)
return string.match(line, ssh_manager_key_trailer .. '$')
end

local function line_is_seperator(line)
return string.match(line, '^' .. ssh_manager_seperator .. '$')
local function line_is_separator(line)
return string.match(line, '^' .. ssh_manager_separator .. '$')
end

local function line_is_empty(line)
Expand All @@ -36,7 +36,7 @@ local function delete_managed_keys()
end

for line in file:lines() do
if not line_is_trailed_key(line) and not line_is_seperator(line) and not line_is_empty(line) then
if not line_is_trailed_key(line) and not line_is_separator(line) and not line_is_empty(line) then
table.insert(lines, line)
end
end
Expand Down Expand Up @@ -67,7 +67,7 @@ local function write_keys(key_table)
local file = io.open(dropbear_key_path, 'a')

file:write('\n')
file:write(ssh_manager_seperator, '\n')
file:write(ssh_manager_separator, '\n')
for _, key in ipairs(key_table) do
file:write(key .. ssh_manager_key_trailer, '\n')
end
Expand Down