ソースを参照

Merge pull request #49 from nachoparker/master

refactor installation script
tags/v1.2.2
azlux 6年前
committed by GitHub
コミット
1b2183b4c3
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: 4AEE18F83AFDEB23
1個のファイルの変更16行の追加26行の削除
  1. +16
    -26
      install.sh

+ 16
- 26
install.sh ファイルの表示

@@ -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 #####"

読み込み中…
キャンセル
保存