Commit f0244ef5 authored by bretello's avatar bretello

make install.sh non-interactive, set dark mode as default

parent 0467d63b
#/bin/bash
theme="DARK" # one of Dark, Light
if [ "$(whoami)" != "root" ]
then echo "This script is not running as root... exiting" && exit 1
fi
......@@ -34,26 +35,13 @@ fi
cp -rv ./web/* ${installdir}/web/
if [ "$1" != "-u" ]
then
echo -e "\nTransmission soft theme successfully installed!\n \nWould you like to apply a soft theme now?\nWARNING: if this is an UPDATE you have to skip this!\nNOTE: if you've already installed it, to change theme just modify the " $installdir "/web/index.html following the instructions on the wiki!\n"
PS3=': '
options=( "Dark" "Light" "Quit" )
select opt in "${options[@]}"
do
case $opt in
"Dark")
sed -i '21i\\t\t<link href="./style/transmission/soft-theme.min.css" type="text/css" rel="stylesheet" />\n\t\t<link href="style/transmission/soft-dark-theme.min.css" type="text/css" rel="stylesheet" />\n' ${installdir}/web/index.html;
echo "Soft dark theme successfully applied!";
break;;
"Light")
sed -i '21i\\t\t<link href="./style/transmission/soft-theme.min.css" type="text/css" rel="stylesheet" />\n\t\t<link href="style/transmission/soft-light-theme.min.css" type="text/css" rel="stylesheet" />\n' ${installdir}/web/index.html;
echo "Soft light theme successfully applied!";
break;;
"Quit")
echo 'You can always install it following the https://git.eigenlab.org/sbiego/transmission-web-soft-theme/wikis/home';
break;;
*) echo 'invalid option'
esac
done
if [ "$1" != "-u" ];then
if [[ $theme == "Dark" ]]; then
sed -i '21i\\t\t<link href="./style/transmission/soft-theme.min.css" type="text/css" rel="stylesheet" />\n\t\t<link href="style/transmission/soft-dark-theme.min.css" type="text/css" rel="stylesheet" />\n' ${installdir}/web/index.html;
echo "Soft dark theme successfully applied!";
fi
if [[ $theme == "Light" ]]; then
sed -i '21i\\t\t<link href="./style/transmission/soft-theme.min.css" type="text/css" rel="stylesheet" />\n\t\t<link href="style/transmission/soft-light-theme.min.css" type="text/css" rel="stylesheet" />\n' ${installdir}/web/index.html;
echo "Soft light theme successfully applied!";
fi
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment