1
0
mirror of https://gitlab.alpinelinux.org/alpine/alpine-baselayout.git synced 2025-04-19 09:42:19 +03:00

add profile.d support

include sample color prompt
This commit is contained in:
Carlo Landmeter 2011-03-31 08:44:50 +00:00
parent 139b9ee7d6
commit 756c2c05c7
3 changed files with 18 additions and 0 deletions

View File

@ -25,6 +25,7 @@ ETC_FILES = TZ \
CONFD_FILES = $(addprefix conf.d/, tuntap vlan)
UDHCPC_FILES =default.script
MODPROBED_FILES =aliases.conf blacklist.conf i386.conf kms.conf
PROFILED_FILES =color_prompt
CRONTABS =crontab
DISTFILES =$(ETC_FILES) $(UDHCPC_FILES) $(MODPROBED_FILES) Makefile
@ -57,6 +58,7 @@ install: $(GENERATED_FILES)
etc/conf.d \
etc/crontabs \
etc/modprobe.d \
etc/profile.d \
etc/network/if-down.d \
etc/network/if-post-down.d \
etc/network/if-pre-up.d \
@ -99,6 +101,7 @@ install: $(GENERATED_FILES)
install -m 0644 $(CONFD_FILES) $(DESTDIR)/etc/conf.d
install -m 0755 $(UDHCPC_FILES) $(DESTDIR)/usr/share/udhcpc
install -m 0755 $(MODPROBED_FILES) $(DESTDIR)/etc/modprobe.d
install -m 0755 $(PROFILED_FILES) $(DESTDIR)/etc/profile.d
mv $(DESTDIR)/etc/crontab $(DESTDIR)/etc/crontabs/root
ln -s /etc/crontabs $(DESTDIR)/var/spool/cron/crontabs
ln -s /proc/mounts $(DESTDIR)/etc/mtab

9
color_prompt Normal file
View File

@ -0,0 +1,9 @@
# Setup a red prompt for root and a green one for users.
NORMAL="\[\e[0m\]"
RED="\[\e[1;31m\]"
GREEN="\[\e[1;32m\]"
if [[ "$USER" == root ]] ; then
PS1="$RED\h [$NORMAL\w$RED]# $NORMAL"
else
PS1="$GREEN\h [$NORMAL\w$GREEN]\$ $NORMAL"
fi

View File

@ -3,3 +3,9 @@ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export PAGER=less
export PS1='\h:\w\$ '
umask 022
for script in /etc/profile.d/*.sh ; do
if [ -r $script ] ; then
. $script
fi
done