OpenVoiceOS/buildroot-external/rootfs-overlay/etc/init.d/S90mycroft_prepare

42 lines
943 B
Plaintext
Raw Normal View History

2018-10-26 19:51:01 +02:00
#!/bin/sh
#
# Prepare Mycroft software stack.
#
start() {
# set the right locale / language settings
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
# Check if Mycroft log folders are present and if not
# create those logging folders
if [[ ! -w /var/log/mycroft/ ]] ; then
# Creating needed folders
printf "Creating /var/log/mycroft/ directory"
if [[ ! -d /var/log/mycroft/ ]] ; then
mkdir /var/log/mycroft/
fi
fi
# Check if /.mycroft exist already and if not
# create a symbolic link to /root/.mycroft
if [[ ! -w /.mycroft/ ]] ; then
# Creating .mycroft symlink
printf "Creating /.mycroft/ symlink"
if [[ ! -d /.mycroft/ ]] ; then
ln -s /root/.mycroft /.mycroft
fi
fi
2018-10-26 19:51:01 +02:00
}
case "$1" in
start)
start
;;
*)
echo "Usage: $0 {start}"
exit 1
esac
exit $?