Add Lutris installer
This commit is contained in:
32
overlay/opt/scripts/install_lutris.sh
Executable file
32
overlay/opt/scripts/install_lutris.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
###
|
||||
# File: install_lutris.sh
|
||||
# Project: scripts
|
||||
# File Created: Thursday, 1st January 1970 12:45:00 pm
|
||||
# Author: Console and webGui login account (jsunnex@gmail.com)
|
||||
# -----
|
||||
# Last Modified: Sunday, 16th January 2022 2:17:37 am
|
||||
# Modified By: Console and webGui login account (jsunnex@gmail.com)
|
||||
###
|
||||
|
||||
pkg=lutris
|
||||
script_path=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd );
|
||||
script_name=$( basename "${BASH_SOURCE[0]}" )
|
||||
|
||||
|
||||
install() {
|
||||
if ! dpkg --get-selections | grep -q "^$pkg[[:space:]]*install$" >/dev/null; then
|
||||
echo "deb http://download.opensuse.org/repositories/home:/strycore/Debian_10/ ./" | tee /etc/apt/sources.list.d/lutris.list
|
||||
wget -q https://download.opensuse.org/repositories/home:/strycore/Debian_10/Release.key -O- | apt-key add -
|
||||
apt-get update
|
||||
apt-get -y install \
|
||||
lutris \
|
||||
python3-dbus
|
||||
|
||||
sed -i '/Exec=lutris %U/c\Exec=/usr/games/lutris %U' /usr/share/applications/net.lutris.Lutris.desktop
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#INSTALLER:
|
||||
source "${script_path}/installer.sh"
|
||||
28
overlay/opt/scripts/installer.sh
Normal file
28
overlay/opt/scripts/installer.sh
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
if [[ "${script_path}" == *"opt/script"* ]]; then
|
||||
while true; do
|
||||
echo
|
||||
read -p "Would you like to configure this container to install ${pkg^} on startup? (Y/N) " ans
|
||||
|
||||
case $ans in
|
||||
[Yy]* ) break;;
|
||||
[Nn]* ) exit;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
|
||||
# Install this script to the home directory init.d
|
||||
dest_file="/home/${USER}/init.d/${script_name}"
|
||||
cp -f "${script_path}/${script_name}" "${dest_file}"
|
||||
# Remove anything under '#INSTALLER:'
|
||||
sed -i '/^#INSTALLER.*$/Q' "${dest_file}"
|
||||
# Append 'install' command
|
||||
echo 'install' >> "${dest_file}"
|
||||
echo
|
||||
echo
|
||||
echo "Installed init script '${dest_file}'"
|
||||
echo "This script will install ${pkg^} when you next restart the container."
|
||||
echo
|
||||
read -s -p "Press any key to continue"
|
||||
echo
|
||||
fi
|
||||
Reference in New Issue
Block a user