This commit is contained in:
wt
2024-09-12 15:12:32 +07:00
parent 1a6972ea2e
commit 8646e4ddd1
5 changed files with 17 additions and 7 deletions
+2 -2
View File
@@ -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"
}
#--------------------------------------------
+1 -1
View File
@@ -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"
;;
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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
+10
View File
@@ -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"