welcome ipfs

This commit is contained in:
Yann Autissier
2022-06-30 23:37:10 +02:00
parent b149a01b75
commit e06266489c
66 changed files with 871 additions and 591 deletions
+2 -1
View File
@@ -1,2 +1,3 @@
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
0 0 * * * root /etc/init.d/myos ansible-pull
@reboot root make ansible-pull > /var/log/ansible-pull.log
0 0 * * * root make ansible-pull > /var/log/ansible-pull.log
+8 -25
View File
@@ -16,44 +16,27 @@ NAME="$(basename "$0")"
type make >/dev/null 2>&1 && [ -d "${MYOS}" ] && cd "${MYOS}" || exit 1
case "$1" in
force-stop)
HOOK="stop stack-node-stop"
shift
;;
force-reload)
HOOK="recreate stack-node-recreate"
shift
;;
force-restart)
HOOK="restart stack-node-restart"
shift
;;
force-shutdown)
HOOK="down stack-node-down"
shift
TARGET='force-recreate'
;;
reload)
HOOK="recreate"
shift
;;
shutdown)
HOOK="down"
shift
TARGET="recreate"
;;
start)
echo "Starting $NAME..."
HOOK="up"
shift
TARGET="up"
;;
status)
HOOK="ps"
shift
TARGET="ps"
;;
stop)
echo "Stopping $NAME..."
TARGET="$1"
;;
*)
TARGET="$1"
;;
esac
shift ||:
IFS=$'\n'; exec env $(cat /etc/default/myos ~/.myos 2>/dev/null) make ${HOOK:-} "${@}"
IFS=$'\n'; exec env $(cat /etc/default/myos 2>/dev/null) make ${TARGET:-} ${TARGET_FORCE:-} $@
@@ -2,7 +2,7 @@
# file rc.sh: Call user defined functions
## author: Yann "aya" Autissier
## license: GPL
## version: 20210714
## version: 20220630
case $- in
# if this is an interactive shell
@@ -24,7 +24,7 @@ case $- in
fi
done
# load user stuff from RC_* env vars
IFS="$(printf '%b_' '\n')"; IFS="${IFS%_}"; for line in $(printenv 2>/dev/null |awk '$0 ~ /^RC_[1-9A-Z_]*=/'); do
IFS="$(printf '%b_' '\n')"; IFS="${IFS%_}"; for line in $(printenv 2>/dev/null |awk '$0 ~ /^RC_[0-9A-Z_]*=/' |sort); do
func_name=$(printf '%s\n' "${line%%=*}" |awk '{print tolower(substr($0,4))}')
eval func_args=\$"${line%%=*}"
[ "${func_args}" = "false" ] && continue
@@ -2,7 +2,7 @@
# file rc_functions.sh: Define shell functions
## author: Yann "aya" Autissier
## license: GPL
## version: 20220620
## version: 20220630
# function force: Run a command sine die
force() {
@@ -40,9 +40,8 @@ force8() {
# function load_average; Print the current load average
load_average() {
awk '{printf "%.1f\n" $1}' /proc/loadavg 2>/dev/null\
|| uptime 2>/dev/null |awk '{printf "%.1f\n", $(NF-2)}'
}
uptime 2>/dev/null |awk '{printf "%.1f\n", $(NF-2)}'
}
# function process_count: Print number of "processes"/"running processes"/"D-state"
process_count() {
@@ -3,7 +3,7 @@ Description=Call myos ansible-pull
[Service]
Type=oneshot
ExecStart=/etc/init.d/myos ansible-pull
ExecStart=make ansible-pull
[Install]
WantedBy=multi-user.target