Bladeren bron

Merge pull request #49 from nachoparker/master

refactor installation script
tags/v1.2.2
azlux 6 jaren geleden
committed by GitHub
bovenliggende
commit
1b2183b4c3
Geen bekende sleutel gevonden voor deze handtekening in de database GPG sleutel-ID: 4AEE18F83AFDEB23
1 gewijzigde bestanden met toevoegingen van 16 en 26 verwijderingen
  1. +16
    -26
      install.sh

+ 16
- 26
install.sh Bestand weergeven

@@ -1,34 +1,24 @@
#!/usr/bin/env sh

systemctl -q is-active log2ram && { echo "ERROR: log2ram service is still running. Please run \"sudo service log2ram stop\" to stop it."; exit 1; }
[ "$(id -u)" -eq 0 ] || { echo "You need to be ROOT (sudo can be used)"; exit 1; }

# log2ram
mkdir -p /usr/local/bin/
install -m 644 log2ram.service /etc/systemd/system/log2ram.service
install -m 755 log2ram /usr/local/bin/log2ram
install -m 644 log2ram.conf /etc/log2ram.conf
install -m 644 uninstall.sh /usr/local/bin/uninstall-log2ram.sh
systemctl enable log2ram

if [ "$(id -u)" -eq 0 ]
then
[ -d /usr/local/bin/ ] || mkdir /usr/local/bin/
cp log2ram.service /etc/systemd/system/log2ram.service
chmod 644 /etc/systemd/system/log2ram.service
cp log2ram /usr/local/bin/log2ram
chmod a+x /usr/local/bin/log2ram
cp log2ram.conf /etc/log2ram.conf
chmod 644 /etc/log2ram.conf
systemctl enable log2ram
cp log2ram.hourly /etc/cron.hourly/log2ram
chmod +x /etc/cron.hourly/log2ram
cp log2ram.logrotate /etc/logrotate.d/log2ram
chmod 644 /etc/logrotate.d/log2ram
cp uninstall.sh /usr/local/bin/uninstall-log2ram.sh
# cron
install -m 755 log2ram.hourly /etc/cron.hourly/log2ram
install -m 644 log2ram.logrotate /etc/logrotate.d/log2ram

# Remove a previous log2ram version
if [ -d /var/log.hdd ]; then
rm -r /var/log.hdd
fi
# Remove a previous log2ram version
rm -rf /var/log.hdd

if [ -d /var/hdd.log ]; then
rm -r /var/hdd.log
fi
# Make sure we start clean
rm -rf /var/hdd.log

echo "##### Reboot to activate log2ram #####"
else
echo "You need to be ROOT (sudo can be used)"
fi
echo "##### Reboot to activate log2ram #####"

Laden…
Annuleren
Opslaan