dev: Added more prompts to install script
This commit is contained in:
parent
9d2530ab02
commit
b243bc7bb4
1 changed files with 21 additions and 10 deletions
31
install.sh
31
install.sh
|
@ -13,7 +13,12 @@ printf "\e[1;34mDisco\e[1;38;5;208mRSS\e[0m Install Helper Script\n\n"
|
|||
|
||||
workingDir=$(pwd)
|
||||
|
||||
cat << EOF > discorss.service
|
||||
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
|
||||
[Unit]
|
||||
Description=Discord RSS feeder
|
||||
Wants=discorss.timer
|
||||
|
@ -28,7 +33,8 @@ WantedBy=default.target
|
|||
|
||||
EOF
|
||||
|
||||
cat << EOF > discorss.timer
|
||||
cat << EOF > discorss.timer
|
||||
# Autogenerated by install.sh
|
||||
[Unit]
|
||||
Description=Timer for DiscoRSS
|
||||
Requires=discorss.service
|
||||
|
@ -43,13 +49,18 @@ WantedBy=timers.target
|
|||
|
||||
EOF
|
||||
|
||||
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 "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
|
||||
|
||||
printf "Would you like a basic example config created for you? [y/n]: "
|
||||
read answer1
|
||||
|
@ -84,4 +95,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!"
|
||||
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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue