aboutsummarylogtreecommitdiffstats
path: root/uau.install
blob: c73ec6f405cdfcbd6a18bbc0234e055d728035cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
post_install() {
    . /etc/unattended-arch-upgrade.conf

    useradd $UPDATEUSER -G systemd-journal -m
    # no account expiry, never set to inactive, no password expiry
    chage -E -1 -I -1 -m -1 -M -1 $UPDATEUSER

    systemctl enable unattended-arch-upgrade.timer
    systemctl start unattended-arch-upgrade.timer
    systemctl list-timers unattended-arch-upgrade.timer
    systemctl daemon-reload

    sed -i '/\[options\]/a Include=/etc/unattended-arch-upgrade.ignore' $PACCONF

    mkdir -p $LOGDIR
    chown $UPDATEUSER $LOGDIR

    chmod 644 /etc/cron.d/archnews
}

post_upgrade(){
    systemctl daemon-reload
}

pre_remove() {
    . /etc/unattended-arch-upgrade.conf
    
    sed -i 's#Include=/etc/unattended-arch-upgrade.ignore##g' $PACCONF

    systemctl stop unattended-arch-upgrade.timer
    systemctl disable unattended-arch-upgrade.timer
    userdel $UPDATEUSER -r
}