Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LSH
lsh
Commits
4553c87f
Commit
4553c87f
authored
Jan 10, 2003
by
Niels Möller
Browse files
New shell script.
Rev: src/lsh-upgrade:1.1
parent
b2e3194b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lsh-upgrade
0 → 100755
View file @
4553c87f
#! /bin/sh
# A script for upgrading files under .lsh for lsh-2.0
werror
()
{
echo
"
$1
"
>
&2
}
die
()
{
werror
"
$1
"
exit
1
}
if
[
$#
-ne
0
]
;
then
werror
"Updates older lsh files to work with lsh-2.0"
werror
""
werror
"Usage: lsh-upgrade"
exit
1
fi
:
${
SEXP_CONV
:
=sexp-conv
}
cd
"
$HOME
/.lsh"
||
die
"No .lsh directory, so nothing to do."
if
[
-s
host-acls
]
;
then
werror
"~/.lsh/host-acls already exists, so I won't touch that."
else
if
[
-s
known_hosts
]
;
then
werror
"Converting known_hosts to host-acls"
# These are the changes we must make:
#
# * The subject of an acl must be enclosed in a subject-expression
#
# * Numbers are signed, so the most significant bit of all our
# numbers must be 0. So we add a leading zero octet to numbers
# that need it.
"
$SEXP_CONV
"
-s
hex <known_hosts
\
|
sed
-e
's,(entry ,(entry (subject ,'
\
-e
's,(tag ,)(tag ,'
\
-e
's,(\(.\) #\([89a-fA-F]\),(\1 #00\2,'
\
|
"
$SEXP_CONV
"
>
host-acls
fi
fi
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment