1
0
mirror of https://github.com/azlux/log2ram.git synced 2023-10-10 13:37:24 +02:00

Update install.sh

Suppress rc-service status message
This commit is contained in:
MegaV0lt 2019-09-24 13:40:26 +02:00 committed by GitHub
parent 3740b50ec7
commit 9c42a06d25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,9 +1,9 @@
#!/usr/bin/env sh #!/usr/bin/env sh
[ "$(id -u)" -eq 0 ] || { echo "You need to be ROOT (sudo can be used)"; exit 1; } [ "$(id -u)" -eq 0 ] || { echo 'You need to be ROOT (sudo can be used)' ; exit 1 ; }
# See if we can find out the init-system # See if we can find out the init-system
echo "Try to detect init and running log2ram service..." echo 'Try to detect init and running log2ram service...'
if [ "$(systemctl --version 2> /dev/null)" != '' ] ; then if [ "$(systemctl --version 2> /dev/null)" != '' ] ; then
INIT='systemd' INIT='systemd'
elif [ "$(rc-service --version 2> /dev/null)" != '' ] ; then elif [ "$(rc-service --version 2> /dev/null)" != '' ] ; then
@ -12,13 +12,14 @@ fi
case "$INIT" in case "$INIT" in
systemd) systemd)
systemctl -q is-active log2ram && { echo "ERROR: log2ram service is still running. Please run \"sudo service log2ram stop\" to stop it."; exit 1; } ;; systemctl -q is-active log2ram && { echo 'ERROR: log2ram service is still running. Please run "sudo service log2ram stop" to stop it.' ; exit 1 ; } ;;
openrc) openrc)
rc-service log2ram status && { echo "ERROR: log2ram service is still running. Please run \"sudo rc-service log2ram stop\" to stop it."; exit 1; } ;; rc-service log2ram status 2>1 >/dev/null && { echo 'ERROR: log2ram service is still running. Please run "sudo rc-service log2ram stop" to stop it.' ; exit 1 ; } ;;
*) echo 'ERROR: could not detect init-system' ; exit 1 *) echo 'ERROR: could not detect init-system' ; exit 1
;; ;;
esac esac
echo "installing files for ${INIT}..."
# log2ram # log2ram
mkdir -p /usr/local/bin/ mkdir -p /usr/local/bin/
install -m 755 log2ram /usr/local/bin/log2ram install -m 755 log2ram /usr/local/bin/log2ram
@ -46,5 +47,5 @@ rm -rf /var/log.hdd
# Make sure we start clean # Make sure we start clean
rm -rf /var/hdd.log rm -rf /var/hdd.log
echo "##### Reboot to activate log2ram #####" echo '##### Reboot to activate log2ram! #####'
echo "##### edit /etc/log2ram.conf to configure options ####" echo '##### Edit /etc/log2ram.conf to configure options #####'