distribution/packages/jelos/autostart/099-networkservices
fewtarius bff71cd5e2
* Add additional feedback to the boot process so it's visible to the user.
* Add support for a variant of JELOS suitable for hosting containers.
* Fix desktop mode terminal bug.
2023-04-22 20:01:07 +00:00

41 lines
718 B
Bash
Executable file

#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
. /etc/profile
tocon "Starting services..."
for SERVICE in /usr/lib/autostart/daemons/*
do
source ${SERVICE}
if [ ! -d "/storage/.cache/services" ]
then
mkdir -p "/storage/.cache/services"
fi
if [ -n "${CONF}" ] && \
[ -e "/storage/.cache/services/${CONF}" ]
then
rm -f "/storage/.cache/services/${CONF}"
fi
statemgr() {
for daemon in ${DAEMONS[@]}
do
nohup systemctl ${1} ${daemon} &
done
}
case "$STATE" in
"1")
touch "/storage/.cache/services/${CONF}"
statemgr start
;;
*)
statemgr stop
;;
esac
done