summarylogtreecommitdiffstats
path: root/run.sh
blob: 07873a372c7050ab2383605cf625cf5252050cfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash

#  _  __                  _         __  __
# | |/ /__ _ _ _ __ _ ___| |_____  |  \/  |_  _ __ _ ___ _ _
# | ' </ _` | '_/ _` / _ \ / / -_) | |\/| | || / _` / -_) ' \
# |_|\_\__,_|_| \__,_\___/_\_\___| |_|  |_|\_,_\__, \___|_||_|
#                                              |___/

# This script runs Karaoke Mugen app (with some check to avoid some disasters)
# From AUR package karaokemugen-git

# use colors only if we have them
if [[ $(which tput > /dev/null 2>&1 && tput -T "${TERM}" colors || echo -n '0') -ge 8 ]] ; then
    _COL_YELLOW_='\e[0;33m'
    _COL_BLUE_='\e[0;34m'
    _COL_DEFAULT_='\e[0m'
fi

# Check if postgres is running
if systemctl is-active postgresql -q ; then
    echo "Starting Karaoke Mugen..."
else
    echo -e "${_COL_YELLOW_}⚠️ Postgres seems down... Trying to start PostgreSQL before Karaoke Mugen.${_COL_DEFAULT_}"
    echo -e "${_COL_BLUE_}You may want to start PostgreSQL at boot with `systemctl enable postgresql`.${_COL_DEFAULT_}"
    systemctl start postgresql
fi
# Launch Karaoke Mugen
exec electron /usr/lib/karaokemugen/app.asar "$@"