From 2d801a81c04fe763bc9c641f730bb74498aa0fdb Mon Sep 17 00:00:00 2001 From: Erreur32 Date: Thu, 20 Jul 2017 15:01:54 +0200 Subject: [PATCH] Update Install.sh --- Install.sh | 68 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 52 insertions(+), 16 deletions(-) diff --git a/Install.sh b/Install.sh index 75f4e19..5236de3 100755 --- a/Install.sh +++ b/Install.sh @@ -1,42 +1,78 @@ -#!/bin/bash +#!/bin/sh # -# Installation of MOTDs32 +# MOTDs32 installation instructions +# ================================== +# +# (2017) New project MOTDs32 by Erreur32 # Author: Erreur32 # Version 0.0.5 # +# https://gitlab.echosystem.fr/Erreur32/MOTDs32 +# +# ,--. ,--. ,-----. ,--------.,------. ,----. ,---. +# | `.' |' .-. ''--. .--'| .-. \ ,---. '.-. |'.-. \ +# | |'.'| || | | | | | | | \ :( .-' .' < .-' .' +# | | | |' '-' ' | | | '--' /.-' `)/'-' |/ '-. +# `--' `--' `-----' `--' `-------' `----' `----' '-----' +# +# | + Stats32 | # MOTDstat is dynamicaly refreshing the /etc/motd file with current informations # about system status and usage. # # Copyright 2017 Erreur32 # original project: Pavol Krigler # - +# +################################################################################ +# +# Installation +# ============ +# +# As root execute this command (the easy way!): +# +# ./Install.sh +# +################################################################################ + +## clean terminal clear; -echo -n "Do you wish to install the missing package before (y/n)? --> apt-get install ntp figlet ?" +## Install command in bashrc +echo "cat /etc/motd" >> /root/.bashrc + +## Insdtall modules +#mkdir /etc/motds32 + +if [ -e /etc/motds32/Stats32] + then + echo -e "Stats32 already installed" + else + mkdir /etc/motds32; + cp Stats32 /etc/motds32/Stats32 -Rf +fi + +if [ -e /usr/bin/motd] + then + echo -e "motd already installed" + else + ln -s /usr/bin/motds32 /usr/bin/motd + +fi + +echo -e "Do you wish to install the missing package before (y/n)? \n --> apt-get install ntp figlet ?" old_stty_cfg=$(stty -g) stty raw -echo answer=$( while ! head -c 1 | grep -i '[ny]' ;do true ;done ) stty $old_stty_cfg if echo "$answer" | grep -iq "^y" ;then - echo -e "/n Yes install ntp figlet" ; apt-get install -y ntp figlet; make install + echo -e "/n OK installation start: ntp figlet" ; apt-get install -y ntp figlet; make install else echo -e "/n No continue without"; make install fi - -## Install command in bashrc -echo "cat /etc/motd" >> /root/.bashrc - - -## Insdtall modules -#mkdir /etc/motds32 -cp Stats32 /etc/motds32/Stats32 -ln -s /usr/bin/motds32 /usr/bin/motd - ## Install Crontab -echo "add ENTRY in crontab (generation each 5 minutes)" +echo -e "\n \n Add ENTRY in ROOT crontab (generation each 5 minutes)" crontab << FIN $(crontab -l)