mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-06-09 01:47:32 +08:00
Colors in log
This commit is contained in:
parent
3bc53e7f1e
commit
b134334fed
@ -3,6 +3,9 @@
|
|||||||
PIDFILE="/var/run/agent.pid"
|
PIDFILE="/var/run/agent.pid"
|
||||||
SCRIPT="/usr/local/bin/agent.sh"
|
SCRIPT="/usr/local/bin/agent.sh"
|
||||||
|
|
||||||
|
error () { echo -e "\E[1;31m❯ ERROR: $1\E[0m" ; }
|
||||||
|
info () { echo -e "\E[1;34m❯\E[1;36m $1\E[0m" ; }
|
||||||
|
|
||||||
status() {
|
status() {
|
||||||
|
|
||||||
if [ -f "$PIDFILE" ] && kill -0 "$(cat "$PIDFILE")"; then
|
if [ -f "$PIDFILE" ] && kill -0 "$(cat "$PIDFILE")"; then
|
||||||
@ -25,7 +28,7 @@ start() {
|
|||||||
|
|
||||||
if [ ! -f "$SCRIPT" ]; then
|
if [ ! -f "$SCRIPT" ]; then
|
||||||
|
|
||||||
echo 'ERROR: Agent script not found!' > /dev/ttyS0
|
error 'Agent script not found!' > /dev/ttyS0
|
||||||
|
|
||||||
URL="https://raw.githubusercontent.com/kroese/virtual-dsm/master/agent/agent.sh"
|
URL="https://raw.githubusercontent.com/kroese/virtual-dsm/master/agent/agent.sh"
|
||||||
|
|
||||||
@ -54,7 +57,7 @@ stop() {
|
|||||||
echo 'Stopping agent service...'
|
echo 'Stopping agent service...'
|
||||||
|
|
||||||
chmod 666 /dev/ttyS0
|
chmod 666 /dev/ttyS0
|
||||||
echo 'Stopping agent service...' > /dev/ttyS0
|
info 'Stopping agent service...' > /dev/ttyS0
|
||||||
|
|
||||||
kill -15 "$(cat "$PIDFILE")" && rm -f "$PIDFILE"
|
kill -15 "$(cat "$PIDFILE")" && rm -f "$PIDFILE"
|
||||||
rm -f /var/lock/subsys/agent.sh
|
rm -f /var/lock/subsys/agent.sh
|
||||||
|
Loading…
x
Reference in New Issue
Block a user