Compare commits

..

No commits in common. "1787d4da993beb0cfe5872360833637d1d224652" and "9d2530ab02803d27be53dc55111f78fbaed0f192" have entirely different histories.

View file

@ -13,20 +13,7 @@ printf "\e[1;34mDisco\e[1;38;5;208mRSS\e[0m Install Helper Script\n\n"
workingDir=$(pwd)
# bail if we're on a non-systemd system, suggest cron
if [[ -d /run/systemd/system ]]; then
printf "systemd detected..."
else
printf "This script and DiscoRSS in general are optimized for systemd! You can use cron as a substitute but I haven't written any documentation for it, so you're on your own for now!"
exit 127 # command not found exit code
fi
printf "Would you like the systemd service and timer files created for you? [y/n]: "
read answer
if [[ "$answer" =~ ^([yY])$ ]]; then
cat << EOF > discorss.service
# Autogenerated by install.sh
cat << EOF > discorss.service
[Unit]
Description=Discord RSS feeder
Wants=discorss.timer
@ -41,8 +28,7 @@ WantedBy=default.target
EOF
cat << EOF > discorss.timer
# Autogenerated by install.sh
cat << EOF > discorss.timer
[Unit]
Description=Timer for DiscoRSS
Requires=discorss.service
@ -57,18 +43,13 @@ WantedBy=timers.target
EOF
printf "Making ~/.config/systemd/user in case it doesn't exist ...\n"
mkdir -p -v ~/.config/systemd/user/
printf "Copying service and timer files there ... \n"
cp discorss.service ~/.config/systemd/user/
cp discorss.timer ~/.config/systemd/user/
rm -f discorss.service
rm -f discorss.timer
printf "Reloading systemd daemon ... \n\n"
systemctl --user daemon-reload
else
printf "This script is intended to be automatically run. It's designed with systemd in mind, but you are free to use any automation tools. You can look at this script for examples of how to structure systemd user services and timers.\nOf course, you could always run it by hand, if you really want to :)\n\n"
fi
mkdir -p ~/.config/systemd/user/
cp discorss.service ~/.config/systemd/user/
cp discorss.timer ~/.config/systemd/user/
rm -f discorss.service
rm -f discorss.timer
systemctl --user daemon-reload
printf "Would you like a basic example config created for you? [y/n]: "
read answer1
@ -103,4 +84,4 @@ fi
printf "\n\nYou should be almost ready to go! Double-check your config files, and check \e[1;32msystemctl --user list-timers\e[0m once the discorss.timer is enabled to see when it will fire next. The default is every 5 minutes."
printf "\nRemember, if you need help or encounter any bugs, contact me via the issues tracker on the git repository where you got this from!\n"
printf "\nRemember, if you need help or encounter any bugs, contact me via the issues tracker on the git repository where you got this from!"