1
0
mirror of https://shylinux.com/x/ContextOS synced 2025-04-25 16:58:06 +08:00
ContextOS/bin/node.sh
2019-02-02 21:05:50 +08:00

28 lines
472 B
Bash
Executable File

#! /bin/bash
export box="http://localhost:9094"
bench="bench"
log() {
echo -e $*
}
prepare() {
mkdir -p bin etc usr
mkdir -p var/run var/log var/tmp
}
main() {
while true; do
$bench "$@" 2>var/log/boot.log && break
log "restarting..." && sleep 3
done
}
case $1 in
create) mkdir $2 && cd $2 && shift && shift && prepare && main "$@";;
init) shift; prepare && main "$@";;
*) mkdir -p var/run var/log && main "$@";;
esac