-
Notifications
You must be signed in to change notification settings - Fork 957
Expand file tree
/
Copy pathinit-alpine.sh
More file actions
49 lines (40 loc) · 1.28 KB
/
init-alpine.sh
File metadata and controls
49 lines (40 loc) · 1.28 KB
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
set -e # Exit immediately on Failure
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/share/bin:/usr/share/sbin:/usr/local/bin:/usr/local/sbin:/system/bin:/system/xbin:$PREFIX/local/bin
export PS1="\[\e[38;5;46m\]\u\[\033[39m\]@localhost \[\033[39m\]\w \[\033[0m\]\\$ "
export PIP_BREAK_SYSTEM_PACKAGES=1
export HOME=/home
export TERM=xterm-256color
required_packages="bash"
missing_packages=""
for pkg in $required_packages; do
if ! apk info -e $pkg >/dev/null 2>&1; then
missing_packages="$missing_packages $pkg"
fi
done
if [ -n "$missing_packages" ]; then
echo -e "\e[34;1m[*] \e[0mInstalling Important packages\e[0m"
apk update && apk upgrade
apk add $missing_packages
if [ $? -eq 0 ]; then
echo -e "\e[32;1m[+] \e[0mSuccessfully Installed\e[0m"
fi
echo -e "\e[34m[*] \e[0mUse \e[32mapk\e[0m to install new packages\e[0m"
fi
if [[ ! -f /linkerconfig/ld.config.txt ]];then
mkdir -p /linkerconfig
touch /linkerconfig/ld.config.txt
fi
[ ! -L /bin/login ] && mv /bin/login /bin/real_login
ln -sf /bin/bash /bin/login
if [ "$1" = "--installing" ]; then
mkdir -p $PREFIX/.configured
echo "Installation completed."
exit 0
fi
if [ "$#" -eq 0 ]; then
echo "$$" > $PREFIX/pid
chmod +x $PREFIX/axs
$PREFIX/axs
else
exec "$@"
fi