From 8646e4ddd10bd208057755740727355fa9ebf909 Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Thu, 12 Sep 2024 15:12:32 +0700 Subject: [PATCH] rootfs --- rootfs/etc/init.d/funcs/init-funcs | 4 ++-- rootfs/etc/init.d/hostname | 2 +- rootfs/etc/init.d/networking | 4 ++-- rootfs/etc/init.d/virtualfilesystems | 4 ++-- rootfs/etc/profile | 10 ++++++++++ 5 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 rootfs/etc/profile diff --git a/rootfs/etc/init.d/funcs/init-funcs b/rootfs/etc/init.d/funcs/init-funcs index 5074d0e..7ceba62 100644 --- a/rootfs/etc/init.d/funcs/init-funcs +++ b/rootfs/etc/init.d/funcs/init-funcs @@ -36,9 +36,9 @@ rc() { #---------- check status function ----------- check() { if [ $1 -ne 0 ]; then - printf "$URED** ERROR: $2\n$RESET" + printf "$BBLUE**$BRED ERROR: $2\n$RESET" return fi - printf "$UGREEN** SUCCESS: $2\n$RESET" + printf "$BBLUE**$BGREEN SUCCESS: $2\n$RESET" } #-------------------------------------------- diff --git a/rootfs/etc/init.d/hostname b/rootfs/etc/init.d/hostname index 515f2b4..7cdb047 100644 --- a/rootfs/etc/init.d/hostname +++ b/rootfs/etc/init.d/hostname @@ -5,7 +5,7 @@ case "$1" in start) - printf "$UYELLOW** Setting up hostname\n$RESET" + printf "$BBLUE**$BYELLOW Setting up hostname\n$RESET" /bin/hostname -F /etc/hostname check $? "Set up hostname" ;; diff --git a/rootfs/etc/init.d/networking b/rootfs/etc/init.d/networking index e3a7f62..202652f 100644 --- a/rootfs/etc/init.d/networking +++ b/rootfs/etc/init.d/networking @@ -5,13 +5,13 @@ case "$1" in start) - printf "$UYELLOW** Starting networking\n$RESET" + printf "$BBLUE**$BYELLOW Starting networking\n$RESET" /sbin/ifup -a &> /dev/null check $? "networking" echo $! > /var/run/networking.pid ;; stop) - printf "$UYELLOW Stopping netowrking\n$RESET" + printf "$BBLUE**$BYELLOW Stopping netowrking\n$RESET" /sbin/ifdown -a check $? "Stop networking" if [ -f /var/run/networking.pid ]; then diff --git a/rootfs/etc/init.d/virtualfilesystems b/rootfs/etc/init.d/virtualfilesystems index a0ca907..03e2b84 100644 --- a/rootfs/etc/init.d/virtualfilesystems +++ b/rootfs/etc/init.d/virtualfilesystems @@ -5,13 +5,13 @@ case "$1" in start) - printf "$UYELLOW** Mounting virtual filesystems\n$RESET" + printf "$BBLUE**$BYELLOW Mounting virtual filesystems\n$RESET" mount -t tmpfs tmpfs /var/run check $? "Mount virtual filesystems" echo $! > /var/run/networking.pid ;; stop) - printf "$UYELLOW Umounting virtual filesystems\n$RESET" + printf "$BBLUE**$BYELLOW Umounting virtual filesystems\n$RESET" umount /var/run check $? "Umount virtual filesystems" rm /var/run/networking.pid diff --git a/rootfs/etc/profile b/rootfs/etc/profile new file mode 100644 index 0000000..0dc5d5a --- /dev/null +++ b/rootfs/etc/profile @@ -0,0 +1,10 @@ +export RESET="\033[0m" +export GREEN="\033[1;32m" +export BLUE="\033[1;34m" +export RED="\033[1;31m" +export YELLOW="\033[1;33m" + +export PS1="$BLUE**$BLUE \u$RESET@$RED\h: $GREEN\w $YELLOW\$(date +%d.%m.%Y) \t\n$GREEN\$ $RESET" + +[ $(id -u) -eq 0 ] && export PS1="$RED** \u@\h: \w \$(date +%d.%m.%Y) \t\n\\\$ $RESET" +