<commit_before>#!/bin/bash
# Script Name: AtoMiC NZBHydra systemd update
# Author: TommyE123
# Publisher: http://www.htpcBeginner.com
# License: MIT License (refer to README.md for more details)
#

# DO NOT EDIT ANYTHING UNLESS YOU KNOW WHAT YOU ARE DOING.

sudo sed -i "s@ExecStart=python /path-to/nzbhydra/nzbhydra.py --daemon --nobrowser --pidfile /path-to/nzbhydra/nzbhydra.pid@ExecStart=/usr/bin/python $APPPATH/nzbhydra.py --daemon --nobrowser --pidfile $APPPIDFILE --config $APPSETTINGS --database $APPPATH/nzbhydra.db@g" /etc/systemd/system/$APPSYSTEMD  || { echo -e $RED'Modifying ExecStart in SYSTEMD file failed.'$ENDCOLOR; exit 1; }
sudo sed -i "s@User=ChangeMe@User=$UNAME@g" /etc/systemd/system/$APPSYSTEMD  || { echo -e $RED'Modifying USER in SYSTEMD file failed.'$ENDCOLOR; exit 1; }
sudo sed -i "s@Group=ChangeMe@Group=$UGROUP@g" /etc/systemd/system/$APPSYSTEMD  || { echo -e $RED'Modifying GROUP in SYSTEMD file failed.'$ENDCOLOR; exit 1; }
sudo sed -i "s@^PIDFile=/path-to/nzbhydra/nzbhydra.pid@PIDFile=$APPPIDFILE@g" /etc/systemd/system/$APPSYSTEMD || { echo -e $RED'Replacing PIDFile failed.'$ENDCOLOR ; exit 1; }
sudo sed -i '/Type=forking/a RuntimeDirectoryMode=775' /etc/systemd/system/$APPSYSTEMD  || { echo -e $RED'Adding RUNTIMEDIRECTORYMODE in SYSTEMD file failed.'$ENDCOLOR; exit 1; }
sudo sed -i '/Type=forking/a RuntimeDirectory=nzbhydra' /etc/systemd/system/$APPSYSTEMD  || { echo -e $RED'Adding RUNTIMEDIRECTORY in SYSTEMD file failed.'$ENDCOLOR; exit 1; }

sudo systemctl daemon-reload
sudo systemctl enable $APPSYSTEMD
<commit_msg>NZBHydra - Fix update of systemd file<commit_after>#!/bin/bash
# Script Name: AtoMiC NZBHydra systemd update
# Author: TommyE123
# Publisher: http://www.htpcBeginner.com
# License: MIT License (refer to README.md for more details)

# DO NOT EDIT ANYTHING UNLESS YOU KNOW WHAT YOU ARE DOING.

sudo sed -i "s@ExecStart=/path-to/python2 /path-to/nzbhydra/nzbhydra.py --nobrowser@ExecStart=/usr/bin/python2 $APPPATH/nzbhydra.py --nobrowser --config $APPSETTINGS --database $APPPATH/nzbhydra.db@g" /etc/systemd/system/$APPSYSTEMD || { echo -e $RED'Modifying ExecStart in SYSTEMD file failed.'$ENDCOLOR; exit 1; }
sudo sed -i "s@User=nzbhydra@User=$UNAME@g" /etc/systemd/system/$APPSYSTEMD || { echo -e $RED'Modifying USER in SYSTEMD file failed.'$ENDCOLOR; exit 1; }
sudo sed -i "s@Group=nzbhydra@Group=$UGROUP@g" /etc/systemd/system/$APPSYSTEMD || { echo -e $RED'Modifying GROUP in SYSTEMD file failed.'$ENDCOLOR; exit 1; }

sudo systemctl daemon-reload
sudo systemctl enable $APPSYSTEMD

{'fraction_non_alphanumeric': 0.1384313725490196, 'fraction_numerical': 0.00784313725490196, 'mean_word_length': 4.85091743119266, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '230144', 'n_tokens_mistral': 1047, 'n_tokens_neox': 948, 'n_words': 237}