42 lines
943 B
Bash
Executable File
42 lines
943 B
Bash
Executable File
#!/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
|
|
}
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start}"
|
|
exit 1
|
|
esac
|
|
|
|
exit $?
|