mirror of
https://shylinux.com/x/ContextOS
synced 2025-04-26 01:04:06 +08:00
add prepare
This commit is contained in:
parent
802154a989
commit
1895ed3f38
20
bin/ice.sh
20
bin/ice.sh
@ -4,10 +4,30 @@ export ctx_log=${ctx_log:=bin/boot.log}
|
||||
export ctx_pid=${ctx_pid:=var/run/ice.pid}
|
||||
export ctx_mod=${ctx_mod:=gdb,log,ssh,ctx}
|
||||
|
||||
prepare() {
|
||||
[ -d bin ] || mkdir bin
|
||||
[ -e bin/ice.sh ] || (curl -o bin/ice.sh -fsSL $ctx_dev/publish/ice.sh || wget -O bin/ice.sh $ctx_dev/publish/ice.sh) && chmod u+x bin/ice.sh
|
||||
[ -e bin/ice.bin ] && chmod u+x bin/ice.bin && return
|
||||
|
||||
bin="ice"
|
||||
case `uname -s` in
|
||||
Darwin) bin=${bin}.darwin ;;
|
||||
Linux) bin=${bin}.linux ;;
|
||||
*) bin=${bin}.windows ;;
|
||||
esac
|
||||
case `uname -m` in
|
||||
x86_64) bin=${bin}.amd64 ;;
|
||||
arm*) bin=${bin}.arm ;;
|
||||
*) bin=${bin}.386 ;;
|
||||
esac
|
||||
(curl -o bin/ice.bin -fsSL $ctx_dev/publish/${bin} || wget -O bin/ice.bin $ctx_dev/publish/${bin}) && chmod u+x bin/ice.bin
|
||||
}
|
||||
|
||||
restart() {
|
||||
[ -e $ctx_pid ] && kill -2 `cat $ctx_pid` &>/dev/null || echo
|
||||
}
|
||||
start() {
|
||||
prepare
|
||||
trap HUP hup && while true; do
|
||||
date && ice.bin $@ 2>$ctx_log && echo -e \"\n\nrestarting...\" && break
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user