Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
alpine-conf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
17
Issues
17
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
alpine-conf
Commits
b2f97315
Commit
b2f97315
authored
Oct 16, 2007
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vecho. -p option for password. thanks to Alexander Poslavsky
parent
838cb4b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
11 deletions
+33
-11
lbu
lbu
+28
-11
libalpine.sh
libalpine.sh
+5
-0
No files found.
lbu
View file @
b2f97315
...
...
@@ -62,6 +62,7 @@ check_openssl() {
$
OPENSSL
list
-
cipher
-
commands
|
grep
"^$ENCRYPTION$"
>
/
dev
/
null
\
||
die
"Cipher $ENCRYPTION is not supported"
vecho
"OPENSSL installed, cipher can be used"
}
gen_current_tdb
()
{
...
...
@@ -79,9 +80,9 @@ list_add() {
while
[
$#
-
gt
0
]
;
do
filename
=`
echo
"$1"
|
sed
's:^/\+::'
`
if
grep
"^$filename$"
"$list"
>/
dev
/
null
2
>&
1
;
then
[
"$VERBOSE"
]
echo
"$filename is already in $list."
v
echo
"$filename is already in $list."
else
[
"$VERBOSE"
]
&&
echo
"Adding $filename to $list."
v
echo
"Adding $filename to $list."
echo
"$filename"
>>
"$list"
fi
shift
...
...
@@ -97,7 +98,7 @@ list_delete() {
while
[
$#
-
gt
0
]
;
do
filename
=`
echo
"$1"
|
sed
's:^/\+::'
`
mv
"$list"
"$tmp"
[
"$VERBOSE"
]
&&
echo
"Removing $filename from list."
v
echo
"Removing $filename from list."
grep
-
v
"^$filename$"
"$tmp"
>
"$list"
rm
"$tmp"
shift
...
...
@@ -142,7 +143,7 @@ cmd_include() {
show_include
()
{
if
[
-
f
"$INCLUDE_LIST"
]
;
then
[
"$VERBOSE"
]
&&
echo
"Include files:"
v
echo
"Include files:"
cat
"$INCLUDE_LIST"
fi
}
...
...
@@ -193,6 +194,7 @@ cmd_package() {
tmppkg
=
"$tmpdir/$(basename $pkg)"
#
generate
the
packages
.
list
vecho
"Generating package.list"
cd
"$ROOT"
mkdir
-
p
$(
dirname
$
PACKAGES_LIST
)
echo
"#This file is generated by 'lbu package' (lbu $VERSION)"
\
...
...
@@ -211,6 +213,7 @@ cmd_package() {
$
SFIC
--
add
"$CURRENT_TDB"
$
currentlist
#
create
tar
archive
vecho
"Creating tar archive"
[
-
f
"$EXCLUDE_LIST"
]
&&
excl
=
"-X $EXCLUDE_LIST"
[
-
f
"$INCLUDE_LIST"
]
&&
incl
=
"-T $INCLUDE_LIST"
if
[
-
n
"$VERBOSE"
];
then
...
...
@@ -225,15 +228,22 @@ cmd_package() {
tar
$
excl
$
incl
-
c
$
currentlist
|
gzip
-
c
>
"$tmppkg"
rc
=$?
else
tar
$
excl
$
incl
-
c
$
currentlist
|
gzip
-
c
\
|
$
OPENSSL
enc
"-$ENCRYPTION"
-
salt
>
"$tmppkg"
rc
=$?
if
[
-
n
"$PASSWORD"
];
then
tar
$
excl
$
incl
-
c
$
currentlist
|
gzip
-
c
\
|
$
OPENSSL
enc
"-$ENCRYPTION"
-
salt
-
pass
pass
:
"$PASSWORD"
>
"$tmppkg"
rc
=$?
else
tar
$
excl
$
incl
-
c
$
currentlist
|
gzip
-
c
\
|
$
OPENSSL
enc
"-$ENCRYPTION"
-
salt
>
"$tmppkg"
rc
=$?
fi
fi
fi
#
actually
commit
unless
dryrun
mode
if
[
$
rc
-
eq
0
];
then
[
-
z
"$DRYRUN"
]
&&
cp
"$tmppkg"
"$pkg"
vecho
"Copied apk overlay to destination $pkg"
else
rm
-
f
"$CURRENT_TDB"
fi
...
...
@@ -272,15 +282,19 @@ Options:
-d Remove old apk overlay files.
-e Protect configuration with a password.
-n Don't commit, just show what would have been commited.
-p <password> Give encryption password on the command-line
-v Verbose mode.
The following values for <media> is supported: floppy usb
If <media> is not specified, the environment variable LBU_MEDIA will be used.
Pass
ows
protection will use $DEFAULT_CIPHER encryption. Other ciphers can be
Pass
word
protection will use $DEFAULT_CIPHER encryption. Other ciphers can be
used by setting the DEFAULT_CIPHER or ENCRYPTION environment variables.
For possible ciphers, try: openssl -v
The password used to encrypt the file, can either be specified on the command line
(following -p) or using the ENCRYPTION environment variable in /etc/lbu/lbu.conf
The environment varialbes can also be set in $LBU_CONF
"
exit
1
...
...
@@ -333,7 +347,7 @@ cmd_commit() {
if
[
-
n
"$lines"
]
&&
[
"$lines"
!= "$outfile" ]; then
#
More
then
one
apkovl
,
this
is
a
security
concern
[
-
z
"$was_mounted"
]
&&
umount
"$mnt"
[
-
n
"$VERBOSE"
]
&&
echo
"$lines"
v
echo
"$lines"
die
"Found multiple apkovl files. Please use -d to replace them all."
fi
fi
...
...
@@ -360,6 +374,7 @@ cmd_commit() {
#
move
current
to
commited
.
[
"$DRYRUN"
]
||
mv
"$CURRENT_TDB"
"$COMMITED_TDB"
vecho
"Successfully saved apk overlay files"
}
#---------------------------------------------------------------------------
...
...
@@ -398,7 +413,7 @@ cmd_exclude() {
show_exclude
()
{
if
[
-
f
"$EXCLUDE_LIST"
]
;
then
[
"$VERBOSE"
]
&&
echo
"Exclude files:"
v
echo
"Exclude files:"
cat
"$EXCLUDE_LIST"
fi
}
...
...
@@ -495,7 +510,7 @@ case "$cmd" in
esac
#
parse
common
args
while
getopts
"adehlM:nqrv"
opt
;
do
while
getopts
"adehlM:n
p:
qrv"
opt
;
do
case
"$opt"
in
a
)
[
$
SUBCMD
=
status
]
||
usage_
$
SUBCMD
USE_DEFAULT
=
"-a"
...
...
@@ -514,6 +529,8 @@ while getopts "adehlM:nqrv" opt ; do
n
)
[
$
SUBCMD
=
commit
]
||
usage_
$
SUBCMD
DRYRUN
=
"-n"
;;
p
)
PASSWORD
=
"$OPTARG"
;;
q
)
QUIET
=
"$QUIET -q"
;;
r
)
REMOVE
=
"-r"
...
...
libalpine.sh
View file @
b2f97315
...
...
@@ -21,6 +21,11 @@ echon () {
$ECHON
"
$*$NNL
"
}
# echo if in verbose mode
vecho
()
{
[
-n
"
$VERBOSE
"
]
&&
echo
"
$@
"
}
init_tmpdir
()
{
local
omask
=
`
umask
`
local
__tmpd
=
"/tmp/
$PROGRAM
-
${
$}
-
`
date
+%s
`
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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