From 7f2bb07c2ff7b111e1895603fbf10b447a878f93 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Fri, 30 Oct 2015 04:57:07 -0700 Subject: [PATCH] Add kegs scripts to source tree --- setup/kegs-setup-shell.txt | 6 ++++++ setup/kegs.txt | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 setup/kegs-setup-shell.txt create mode 100644 setup/kegs.txt diff --git a/setup/kegs-setup-shell.txt b/setup/kegs-setup-shell.txt new file mode 100644 index 0000000..7e5f02e --- /dev/null +++ b/setup/kegs-setup-shell.txt @@ -0,0 +1,6 @@ +wget -qO /tmp/gsport-setup ivanx.com/a2cloud/setup/gsport-setup.txt +if [[ $(wc -c /tmp/gsport-setup | grep '^0 ') ]]; then + echo "Please connect to the internet to set up KEGS." +else + source /tmp/gsport-setup -k "$@" +fi diff --git a/setup/kegs.txt b/setup/kegs.txt new file mode 100644 index 0000000..7a891f5 --- /dev/null +++ b/setup/kegs.txt @@ -0,0 +1,27 @@ +#!/bin/bash + +if [[ ! $DISPLAY ]]; then + echo "Please run KEGS in an X Window." + echo "(If you are using the console, type 'startx'.)" +else + if [[ -f /usr/local/lib/rom.kegs ]]; then + if [[ ! $(grep snd-pcm-oss /etc/modules) ]]; then + echo "Configuring KEGS sound..." + echo "snd-pcm-oss" | sudo tee -a /etc/modules > /dev/null + [[ ! $(lsmod | grep snd_pcm_oss) ]] && sudo modprobe snd-pcm-oss + fi + + if [[ ! $(dpkg -l xfonts-base 2> /dev/null | grep '^ii') ]]; then + echo "Configuring KEGS fonts..." + sudo apt-get -y update + sudo apt-get -y install xfonts-base &> /dev/null + sudo apt-get -y clean + fi + + exec xkegs + else + kegs-setup + [[ $? -ne 0 ]] && exit 1 + exec kegs + fi +fi