rootfs
This commit is contained in:
1 parent
1a6972ea2e
commit
8646e4ddd1
5 files changed
+17
-7
No files matched your search
@@ -36,9 +36,9 @@ rc() {
|
|||||||
#---------- check status function -----------
|
#---------- check status function -----------
|
||||||
check() {
|
check() {
|
||||||
if [ $1 -ne 0 ]; then
|
if [ $1 -ne 0 ]; then
|
||||||
printf "$URED** ERROR: $2\n$RESET"
|
printf "$BBLUE**$BRED ERROR: $2\n$RESET"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
printf "$UGREEN** SUCCESS: $2\n$RESET"
|
printf "$BBLUE**$BGREEN SUCCESS: $2\n$RESET"
|
||||||
}
|
}
|
||||||
#--------------------------------------------
|
#--------------------------------------------
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
printf "$UYELLOW** Setting up hostname\n$RESET"
|
printf "$BBLUE**$BYELLOW Setting up hostname\n$RESET"
|
||||||
/bin/hostname -F /etc/hostname
|
/bin/hostname -F /etc/hostname
|
||||||
check $? "Set up hostname"
|
check $? "Set up hostname"
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -5,13 +5,13 @@
|
|||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
printf "$UYELLOW** Starting networking\n$RESET"
|
printf "$BBLUE**$BYELLOW Starting networking\n$RESET"
|
||||||
/sbin/ifup -a &> /dev/null
|
/sbin/ifup -a &> /dev/null
|
||||||
check $? "networking"
|
check $? "networking"
|
||||||
echo $! > /var/run/networking.pid
|
echo $! > /var/run/networking.pid
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
printf "$UYELLOW Stopping netowrking\n$RESET"
|
printf "$BBLUE**$BYELLOW Stopping netowrking\n$RESET"
|
||||||
/sbin/ifdown -a
|
/sbin/ifdown -a
|
||||||
check $? "Stop networking"
|
check $? "Stop networking"
|
||||||
if [ -f /var/run/networking.pid ]; then
|
if [ -f /var/run/networking.pid ]; then
|
||||||
|
|||||||
@@ -5,13 +5,13 @@
|
|||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
printf "$UYELLOW** Mounting virtual filesystems\n$RESET"
|
printf "$BBLUE**$BYELLOW Mounting virtual filesystems\n$RESET"
|
||||||
mount -t tmpfs tmpfs /var/run
|
mount -t tmpfs tmpfs /var/run
|
||||||
check $? "Mount virtual filesystems"
|
check $? "Mount virtual filesystems"
|
||||||
echo $! > /var/run/networking.pid
|
echo $! > /var/run/networking.pid
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
printf "$UYELLOW Umounting virtual filesystems\n$RESET"
|
printf "$BBLUE**$BYELLOW Umounting virtual filesystems\n$RESET"
|
||||||
umount /var/run
|
umount /var/run
|
||||||
check $? "Umount virtual filesystems"
|
check $? "Umount virtual filesystems"
|
||||||
rm /var/run/networking.pid
|
rm /var/run/networking.pid
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|
||||||
Reference in new issue
Block a user