mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-14 09:47:06 +00:00
lxc-alpine: fixes for checkbashism
Fix the issues reported by checkbashisms and change back to #!/bin/sh Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Acked-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
parent
fd8c277753
commit
d2b2911c55
@ -1,9 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
# Detect use under userns (unsupported)
|
# Detect use under userns (unsupported)
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
[ "$arg" == "--" ] && break
|
[ "$arg" = "--" ] && break
|
||||||
if [ "$arg" == "--mapped-uid" -o "$arg" == "--mapped-gid" ]; then
|
if [ "$arg" = "--mapped-uid" -o "$arg" = "--mapped-gid" ]; then
|
||||||
echo "This template can't be used for unprivileged containers." 1>&2
|
echo "This template can't be used for unprivileged containers." 1>&2
|
||||||
echo "You may want to try the \"download\" template instead." 1>&2
|
echo "You may want to try the \"download\" template instead." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
@ -11,7 +11,8 @@ for arg in "$@"; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Make sure the usual locations are in PATH
|
# Make sure the usual locations are in PATH
|
||||||
export PATH=$PATH:/usr/sbin:/usr/bin:/sbin:/bin
|
PATH=$PATH:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
|
export PATH
|
||||||
|
|
||||||
key_sha256sums="9c102bcc376af1498d549b77bdbfa815ae86faa1d2d82f040e616b18ef2df2d4 alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub
|
key_sha256sums="9c102bcc376af1498d549b77bdbfa815ae86faa1d2d82f040e616b18ef2df2d4 alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub
|
||||||
2adcf7ce224f476330b5360ca5edb92fd0bf91c92d83292ed028d7c4e26333ab alpine-devel@lists.alpinelinux.org-4d07755e.rsa.pub"
|
2adcf7ce224f476330b5360ca5edb92fd0bf91c92d83292ed028d7c4e26333ab alpine-devel@lists.alpinelinux.org-4d07755e.rsa.pub"
|
||||||
@ -79,7 +80,8 @@ get_static_apk () {
|
|||||||
if [ "$auto_repo_dir" ]; then
|
if [ "$auto_repo_dir" ]; then
|
||||||
mirror_list=$rootfs/usr/share/alpine-mirrors/MIRRORS.txt
|
mirror_list=$rootfs/usr/share/alpine-mirrors/MIRRORS.txt
|
||||||
mirror_count=$(wc -l $mirror_list | cut -d " " -f 1)
|
mirror_count=$(wc -l $mirror_list | cut -d " " -f 1)
|
||||||
repository=$(sed $(expr $RANDOM % $mirror_count + 1)\!d \
|
random=$(hexdump -n 2 -e '/2 "%u"' /dev/urandom)
|
||||||
|
repository=$(sed $(expr $random % $mirror_count + 1)\!d \
|
||||||
$mirror_list)$auto_repo_dir
|
$mirror_list)$auto_repo_dir
|
||||||
echo "Selecting mirror $repository"
|
echo "Selecting mirror $repository"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user