setup and apxtri.js for setup
This commit is contained in:
		| @@ -187,7 +187,7 @@ apxtri.setuptribe = async (tribe, conf) => { | |||||||
|   // this command is ran by the setup.sh |   // this command is ran by the setup.sh | ||||||
|   // grep -q '^127.0.0.1 adminapx.adminapi' /etc/hosts || echo '127.0.0.1 adminapx.adminapi' | sudo tee -a /etc/hosts > /dev/null |   // grep -q '^127.0.0.1 adminapx.adminapi' /etc/hosts || echo '127.0.0.1 adminapx.adminapi' | sudo tee -a /etc/hosts > /dev/null | ||||||
|   const ips = await apxtri.getip(); |   const ips = await apxtri.getip(); | ||||||
|   const nginxrestart = inittribe.nginx.restart |   const nginxrestart = (inittribe.nginx && inittribe.nginx.restart) | ||||||
|     ? inittribe.nginx.restart |     ? inittribe.nginx.restart | ||||||
|     : fs.readJSONSync("../adminapi/apxtri/setup/initadminapi.json").nginx |     : fs.readJSONSync("../adminapi/apxtri/setup/initadminapi.json").nginx | ||||||
|         .restart; |         .restart; | ||||||
|   | |||||||
| @@ -38,18 +38,16 @@ function help { | |||||||
| } | } | ||||||
|  |  | ||||||
| if [ -z "$tribe" ]; then | if [ -z "$tribe" ]; then | ||||||
|  |    echo "Tribe must be defined" | ||||||
|    help |    help | ||||||
| else | else | ||||||
|    if [ "$url" == "newtribe"]; then |    if [ "$url" == "newtribe"]; then | ||||||
|       mkdir -p "${tribe}" |       mkdir -p "${tribe}" | ||||||
|    else |    else | ||||||
|       wget "${url}/${tribe}/setup.objects.tar.gz" |       wget "${url}/${tribe}/setup.objects.tar.gz" | ||||||
|       if [[ $? -eq 0 ]]; then |       if [[ $? -ne 0 ]]; then | ||||||
|          echo "Check the url:$url seems not answer" |          echo "Check the url:$url seems not answer" | ||||||
|          urlko=1 |          help | ||||||
|       fi |  | ||||||
|       if [[ "$urlok" -eq 1 || -z "$tribe" ]]; then |  | ||||||
|          help       |  | ||||||
|       else |       else | ||||||
|          # add 127.0.0.1 town.nation in /ertc/hoss if not already exist to make localhost available |          # add 127.0.0.1 town.nation in /ertc/hoss if not already exist to make localhost available | ||||||
|          dns=$(basename "$PWD" | sed 's/-/./g') |          dns=$(basename "$PWD" | sed 's/-/./g') | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user