1
0
forked from x/ContextOS
This commit is contained in:
shaoying 2020-12-02 09:58:25 +08:00
parent d1d8186112
commit 9c23731e5b
3 changed files with 11 additions and 35 deletions

View File

@ -1,45 +1,23 @@
#! /bin/sh
export PATH=${PWD}/bin:${PWD}:$PATH
export ctx_dev=${ctx_dev:="https://shylinux.com:443"}
export ctx_mod=${ctx_mod:="gdb,log,ssh,ctx"}
export ctx_pid=${ctx_pid:=var/run/ice.pid}
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 -sq $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 -sq $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() {
trap HUP hup && while true; do
date && echo -e "\n\nrestarting..."
echo -e "ctx_dev: $ctx_dev ctx_mod: $ctx_mod ctx_cmd: $ctx_cmd"
ice.bin $@ 2>$ctx_log && break
sleep 3
date && ice.bin $@ 2>$ctx_log && echo -e \"\n\nrestarting...\" && break
done
}
restart() {
[ -e $ctx_pid ] && kill -2 `cat $ctx_pid` || echo
}
shutdown() {
[ -e $ctx_pid ] && kill -3 `cat $ctx_pid` || echo
stop() {
[ -e $ctx_pid ] && kill -3 `cat $ctx_pid` &>/dev/null || echo
}
serve() {
prepare && shutdown && start $@
stop && start $@
}
cmd=$1 && [ -n "$cmd" ] && shift || cmd="serve serve dev"; $cmd $*
cmd=$1 && [ -n \"$cmd\" ] && shift || cmd=serve
$cmd $*

1
go.sum
View File

@ -28,7 +28,6 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8=

View File

@ -5,7 +5,6 @@ import (
_ "github.com/shylinux/icebergs/base"
_ "github.com/shylinux/icebergs/core"
_ "github.com/shylinux/icebergs/misc"
_ "github.com/shylinux/icebergs/misc/alpha"
_ "github.com/shylinux/icebergs/misc/chrome"
_ "github.com/shylinux/icebergs/misc/input"