Skip to content

Commit d412588

Browse files
feat: motd
1 parent e57441e commit d412588

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/plugins/terminal/scripts/init-alpine.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,20 @@ if [ "$#" -eq 0 ]; then
4444
echo "$$" > "$PREFIX/pid"
4545
chmod +x "$PREFIX/axs"
4646

47+
if [ ! -e "$PREFIX/alpine/etc/acode_motd" ]; then
48+
cat <<EOF > "$PREFIX/alpine/etc/acode_motd"
49+
Welcome to Alpine Linux in Acode!
50+
51+
Working with packages:
52+
53+
- Search: apk search <query>
54+
- Install: apk add <package>
55+
- Uninstall: apk del <package>
56+
- Upgrade: apk update && apk upgrade
57+
58+
EOF
59+
fi
60+
4761
# Create initrc if it doesn't exist
4862
if [ ! -e "$PREFIX/alpine/initrc" ]; then
4963
cat <<EOF > "$PREFIX/alpine/initrc"
@@ -56,13 +70,18 @@ if [[ -f /etc/bash/bashrc ]]; then
5670
fi
5771
5872
export PATH=\$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/share/bin:/usr/share/sbin:/usr/local/bin:/usr/local/sbin
59-
export PS1="\[\e[38;5;46m\]\u\[\e[0m\]@localhost \[\e[0m\]\w \[\e[0m\]\\$ "
6073
export HOME=/home
6174
export TERM=xterm-256color
6275
export SHELL=\$(command -v bash)
76+
77+
if [ -f /etc/acode_motd ]; then
78+
cat /etc/acode_motd
79+
fi
80+
6381
EOF
6482
fi
6583

84+
echo 'export PS1="\[\e[38;5;46m\]\u\[\e[0m\]@localhost \[\e[0m\]\w \[\e[0m\]\\$ "' >> $PREFIX/alpine/initrc
6685
chmod +x "$PREFIX/alpine/initrc"
6786
"$PREFIX/axs" -c "bash --rcfile /initrc -i"
6887
else

0 commit comments

Comments
 (0)