This commit is contained in:
aynic.os
2021-07-14 23:58:24 +01:00
parent b6f1b8d798
commit da2f3ed44a
40 changed files with 166 additions and 108 deletions
@@ -0,0 +1,2 @@
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
0 0 * * * root /etc/init.d/myos ansible-pull
+7 -8
View File
@@ -1,24 +1,23 @@
#!/bin/sh
#!/bin/bash
### BEGIN INIT INFO
# Provides: myos
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: System calls from https://github.com/aynicos/myos
# Description: MYOS system call
### END INIT INFO
set -e
# load system configs
[ -r /etc/default/myos ] && . /etc/default/myos
[ -r /etc/sysconfig/myos ] && . /etc/sysconfig/myos
# check system config
[ -r ~/.env ] && . ~/.env || exit 1
[ -r /etc/default/myos ] && . /etc/default/myos || exit 1
type make >/dev/null 2>&1 && [ -d "${MYOS}" ] || exit 2
# load user config
[ -r ~/.myos ] && . ~/.myos
case "$1" in
*)
IFS=$'\n'; exec env $(cat ~/.env 2>/dev/null) make -C "${MYOS}" $@
IFS=$'\n'; exec sh -c "cd ${MYOS} && exec make $@ $(cat /etc/default/myos ~/.myos 2>/dev/null)"
esac
@@ -9,10 +9,10 @@ start() {
/etc/init.d/myos start
}
status() {
/etc/init.d/myos ps
}
stop() {
/etc/init.d/myos stop
}
status() {
/etc/init.d/myos status
}
@@ -1,8 +1,8 @@
# shellcheck shell=sh
# file rc.sh: Call user defined functions
## author: Yann "aya" Autissier
## license: MIT
## version: 20210620
## license: GPL
## version: 20210714
case $- in
# if this is an interactive shell
@@ -1,8 +1,8 @@
# shellcheck shell=sh
# file rc_functions.sh: Define shell functions
## author: Yann "aya" Autissier
## license: MIT
## version: 20210711
## license: GPL
## version: 20210714
# function force: Run a command sine die
force() {
@@ -0,0 +1,9 @@
[Unit]
Description=Call myos ansible-pull
[Service]
Type=oneshot
ExecStart=/etc/init.d/myos ansible-pull
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,9 @@
[Unit]
Description=Call ansible
[Timer]
OnCalendar=*-*-* 00:00:00
Unit=ansible.service
[Install]
WantedBy=timers.target