Hey nice! Could you push that via Github?Hi @Qhiliqq
This script needs some tweaks, I tweaked the one I downloaded for future installations but I think, you should also tweak yours and update it :
1. check if ntp is already installed and running, instead of forcing Installation and ruining the config
why?Code:... 689 timedatectl set-ntp yes
setting this to yes means that you want to use timesyncd "see my post above for the error that this causes when enabled with ntp"
2. systemd / init.d
wouldn't it be weise to ask what startup method to choose even if systemd is available? since you set upCode:95 if [[ $(command -v systemctl) == "" ]]; then 96 USE_SYSTEMD=false 97 fi
USE_SYSTEMD=true
in line 9 it will be the default one.
3. Cron
918 echo "0 0 * * * $SINUSBOTUSER $LOCATION/sinusbot -update >/dev/null" >>/etc/cron.d/sinusbot
There is no flag such as -uptade and> /dev/null 2>&1
would be a proper redirection.
930 echo "0 0 * * * $SINUSBOTUSER youtube-dl -U --restrict-filename >/dev/null" >>/etc/cron.d/ytdl
same issue with redirection and this will return a youtube-dl: command not found "absolute path". Cron clears the whole environment, so there is 2 options:
a. using PATH=/usr/local/bin/ because youtube-dl is in this directory
930 echo "PATH=/usr/bin/local\n0 0 * * * $SINUSBOTUSER youtube-dl -U --restrict-filename > /dev/null 2>&1" >>/etc/cron.d/ytdl
or
930 echo "SHELL=/bin/sh\nPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\n0 0 * * * $SINUSBOTUSER youtube-dl -U --restrict-filename > /dev/null 2>&1" >>/etc/cron.d/ytdl
b. as in sinusbot cron
"echo 0 0 * * * $SINUSBOTUSER /usr/local/bin/youtube-dl -U --restrict-filename > /dev/null 2>&1" >>/etc/cron.d/ytdl
Regards
This would be easier