summaryrefslogblamecommitdiffstats
path: root/mkosi.postinst
blob: 6f2576457c14a62cddcc7cc8cdc474cb0e38632b (plain) (tree)
1
2
3
4
5
6
7
8
9
10

         


                                     




                                

                                                                                

                                                                                                         
                                                                        
 
         





                                            
                                                                      
 
                                                                  
 
                                             
             




                                                            
#!/bin/sh
set -ex
export DEBIAN_FRONTEND=noninteractive
export HOME="/config"

# motd
chmod 644 /etc/update-motd.d/*
systemctl mask motd-news.service
systemctl mask motd-news.timer

# Add update- and security-repositories, and perform upgrade
RELEASE=$(cat /etc/lsb-release | grep DISTRIB_CODENAME | awk -F'=' '{print $2}')
echo "deb http://no.archive.ubuntu.com/ubuntu ${RELEASE}-security main universe" >> /etc/apt/sources.list
echo "deb http://no.archive.ubuntu.com/ubuntu ${RELEASE}-updates main universe" >> /etc/apt/sources.list
apt-get update && apt-get --yes full-upgrade && apt-get --yes autoremove

# sabnzbd
groupadd --system --gid 997 warez
useradd --system --gid warez --uid 997 warez


add-apt-repository --yes ppa:jcfp/nobetas
add-apt-repository --yes ppa:jcfp/sab-addons
apt-get install --yes sabnzbdplus python3-sabyenc par2-tbb python3-pip

pip3 install --no-cache-dir apprise chardet pynzb requests sabyenc

apt-get purge --auto-remove --yes python3-pip
apt-get clean

sed -i 's/USER=/USER=warez/' /etc/default/sabnzbdplus
sed -i 's/CONFIG=/CONFIG=\/config/' /etc/default/sabnzbdplus
sed -i 's/HOST=/HOST=0.0.0.0/' /etc/default/sabnzbdplus
sed -i 's/PORT=/PORT=8080/' /etc/default/sabnzbdplus