Add setup script for linux

This commit is contained in:
Martin Natano
2022-06-19 12:27:33 +02:00
parent 222fd619e7
commit d107e2b8c1
3 changed files with 39 additions and 3 deletions
+31
View File
@@ -0,0 +1,31 @@
#!/bin/sh
set -eu
if [ "$(id -u)" -ne 0 ]; then
echo 'root privileges required' >&2
exit 1
fi
copy_sl_config() {
if [ -e "/opt/itgmania/Themes/Simply Love.old/$1" ]; then
cp "/opt/itgmania/Themes/Simply Love.old/$1" "/opt/itgmania/Themes/Simply Love/$1"
fi
}
cd "$(dirname "$0")"
# Move the old SL release out of the way
[ -d /opt/itgmania/Themes/Simply\ Love ] && mv /opt/itgmania/Themes/Simply\ Love{,.old}
# Install ITGm
[ -d /opt ] || install -d -m 755 -o root -g root /opt
cp -R --preserve=mode,timestamps itgmania /opt
ln -sf /opt/itgmania/itgmania.desktop /usr/share/applications
# Copy persistent files over from the old SL folder
if [ -d /opt/itgmania/Themes/Simply\ Love.old ]; then
copy_sl_config Other/SongManager\ PreferredCourses.txt
copy_sl_config Other/SongManager\ PreferredSongs.txt
rm -rf /opt/itgmania/Themes/Simply\ Love.old
fi