-
Notifications
You must be signed in to change notification settings - Fork 0
/
alpine.sh
executable file
·58 lines (48 loc) · 1.68 KB
/
alpine.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bash
################################
function press_a_key_to_continue {
read -rp ">> Press enter to continue or CTRL-C to abort."
}
function main {
clear
echo ""
echo ">> get-eggs: will install penguins-eggs"
echo "public key: piero.proietti@gmail.com-66b8815d.rsa.pub will installed"
echo ""
press_a_key_to_continue
# prerequisites
apk add shadow fuse lsb-release
# enable sudo
if [ ! -e /usr/bin/sudo ]; then
ln -s /usr/bin/doas /usr/bin/sudo
fi
# enable fuse
if [ ! -e /etc/modules-load.d/fuse.conf ]; then
echo "fuse" | tee /etc/modules-load.d/fuse.conf
fi
arch=$(uname -m)
if [ "$arch" = "x86_64" ]; then
ARCH="x86_64"
elif [ "$arch" = "i686" ]; then
ARCH="x86"
fi
VERSION="10.0.37-r0"
cp -f piero.proietti@gmail.com-66b8815d.rsa.pub /etc/apk/keys/
mkdir -p /tmp/"$DOAS_USER"/packages/alpine/"$ARCH"/
cd /tmp/"$DOAS_USER"/packages/alpine/"$ARCH"/
wget -O penguins-eggs-"$VERSION".apk https://sourceforge.net/projects/penguins-eggs/files/alpine/"$ARCH"/penguins-eggs-"$VERSION".apk/download
wget -O penguins-eggs-bash-completion-"$VERSION".apk https://sourceforge.net/projects/penguins-eggs/files/alpine/"$ARCH"/penguins-eggs-bash-completion-"$VERSION".apk/download
wget -O penguins-eggs-doc-"$VERSION".apk https://sourceforge.net/projects/penguins-eggs/files/alpine/"$ARCH"/penguins-eggs-doc-"$VERSION".apk/download
apk add penguins-eggs*
echo ">> get-eggs: finished! You can remove it"
echo ">> type \"chsh -s /bin/bash\", then \"reboot\""
}
####
# start
###
if command -v doas >/dev/null 2>&1; then
SUDO='doas'
else
SUDO='sudo'
fi
main