From f66703630000561d6858a677aeea04a00eb55447 Mon Sep 17 00:00:00 2001 From: azlux Date: Mon, 18 Apr 2016 14:07:20 +0200 Subject: [PATCH] sudo check --- install.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index b4aba6a..6bd22a2 100644 --- a/install.sh +++ b/install.sh @@ -1,7 +1,12 @@ #!/bin/sh -cp log2ram.service /etc/systemd/system/log2ram.service -cp log2ram /usr/local/bin/log2ram -systemctl enable log2ram - -echo "Reboot to activate log2ram" +if [ `id -u` -eq 0 ] +then + cp log2ram.service /etc/systemd/system/log2ram.service + cp log2ram /usr/local/bin/log2ram + systemctl enable log2ram + + echo "Reboot to activate log2ram" +else + echo "You need to be ROOT (sudo can be used)" +fi