1
0
Fork 0
mirror of https://github.com/NeoCloud/NeoNetwork synced 2024-06-27 02:48:42 +08:00

Regular update: 2020-07-20T18:06:15Z

This commit is contained in:
Septs 2020-07-21 02:06:15 +08:00
parent 8c1b87eaa4
commit af02d7ece0
5 changed files with 55 additions and 62 deletions

View file

@ -1,4 +1,5 @@
#!/usr/bin/env bash
# shellcheck disable=SC1091
set -euo pipefail
IFS=$'\n\t'

View file

@ -1,7 +1,7 @@
#!/bin/sh
set -xeu
if ! which markdown 2>&1 > /dev/null; then
if ! which markdown 2>&1 >/dev/null; then
echo "need markdown"
exit
fi
@ -10,4 +10,4 @@ fi
cat docs/header.html
markdown README.md
cat docs/footer.html
) > docs/index.html
) >docs/index.html

View file

@ -1,7 +1,7 @@
#!/bin/sh
set -xe
if which dot 2>&1 > /dev/null ; then
if which dot 2>&1 >/dev/null; then
dot -T svg nodes.dot -o nodes.svg
else
echo 'You need to install graphviz first'

View file

@ -1,8 +1,8 @@
#!/usr/bin/env bash
set -e
##########################################
# =============== Colors =============== #
##########################################
##########################################
# =============== Colors =============== #
##########################################
ESC='\033'
RESET="${ESC}[0m" #Reset all attributes
@ -28,53 +28,46 @@ BMAGENTA="${ESC}[45m" #Magenta
BCYAN="${ESC}[46m" #Cyan
BWHITE="${ESC}[47m" #White
#########################
# Functions: #
# Make your life easier #
#########################
#########################
# Functions: #
# Make your life easier #
#########################
# Error Message that stops the script
errmsg()
{
errmsg() {
echo -en "${BRED}>>${RESET} ${FMAGENTA}${*}${RESET}"
return 1
}
# Normal Message
msg()
{
msg() {
echo -en "${BBLUE}>>${RESET} ${BRIGHT}${FGREEN}${*}${RESET}"
}
# Debug Level Verbose
dbgmsg()
{
dbgmsg() {
echo -en "${BRIGHT}${BBLUE}>>${RESET} ${BRIGHT}${FGREEN}${*}${RESET}"
}
# Verbose Message
vmsg()
{
vmsg() {
echo -en "${BRIGHT}${BBLUE}>>${RESET} ${BRIGHT}${FCYAN}${*}${RESET}"
}
# Formatted Output
# for TUN30
print_tun30()
{
print_tun30() {
printf "${FGREEN}%-20s${RESET}|${FYELLOW}%10s${RESET}| ${FCYAN}%20s ${BRIGHT}${FBLUE}<--> ${FMAGENTA}%s${RESET}\n" \
"$1" "$2" "$3" "$4"
}
print_subnet()
{
print_subnet() {
printf "${FGREEN}%-20s${RESET}${BRIGHT}${FBLUE}|| ${FMAGENTA}%s${RESET}\n\t>> %s\n" \
"$1" "$2" "$3"
}
print_ptp()
{
print_ptp() {
upstream_ip="${1%~*}"
downstream_ip="${1#$upstream_ip}"
downstream_ip="${downstream_ip#*~}"
@ -83,8 +76,7 @@ print_ptp()
"$2" "$upstream_ip" "$downstream_ip" "$3" "$4"
}
print_lo()
{
print_lo() {
printf "${FGREEN}%-20s${RESET}${BRIGHT}${FBLUE}||${FMAGENTA}%24s${RESET} ${BRIGHT}${FBLUE}|| ${RESET}%s\n" \
"$1" "$2" "$3"
}
@ -123,13 +115,13 @@ route)
subnet="${subnet/,/\/}"
source "$i"
case "$TYPE" in
SUBNET) print_subnet "$subnet" "$NAME" "$DESC";;
LO) print_lo "$subnet" "$NAME" "$DESC";;
*) errmsg "Invalid \$TYPE in $i\n";;
SUBNET) print_subnet "$subnet" "$NAME" "$DESC" ;;
LO) print_lo "$subnet" "$NAME" "$DESC" ;;
*) errmsg "Invalid \$TYPE in $i\n" ;;
esac
done
;;
entity);;
entity) ;;
node)
for i in node/*; do
node="${i#node/}"
@ -145,7 +137,7 @@ node)
done
done
;;
*) errmsg "Invalid type\n";;
*) errmsg "Invalid type\n" ;;
esac
# vim: set tabstop=8:softtabstop=8:shiftwidth=8

View file

@ -2,7 +2,7 @@
set -euo pipefail
IFS=$'\n\t'
if [ ! -n "$SSHPRIVKEY" ]; then
if [ -z "$SSHPRIVKEY" ]; then
echo SSHPRIVKEY is not set
exit 1
fi
@ -13,7 +13,7 @@ chmod 0600 "$HOME/.ssh/id_ed25519"
set -x
cd generated || exit -1
cd generated || exit 1
git remote set-url origin git@github.com:NeoCloud/NeoNetwork-ROA.git
git config user.name "NeoCloud ROA bot"