diff --git a/README.md b/README.md index b3ee43f..b8d4a60 100644 --- a/README.md +++ b/README.md @@ -2,28 +2,41 @@ Screenshot -![logo](/screen_shot.jpg "Screenshot_blank") +![logo](https://labo.olivierdelort.net/olivier/motd/blob/master/screen_shot.jpg "Screenshot_blank") -## Dependencies : +## Configuration : You have to install the rsb-release package to use it. ``` - sudo apt install lsb-release + sudo apt-get install lsb-release ``` -## Install +## Install the developpment release ``` -git clone https://framagit.org/draconis/motd.git +git clone https://labo.olivierdelort.net/olivier/motd.git ``` -Execute the installation's script +Disable the SSH's motd ``` -sudo sh install.sh +sudo sed -i 's/#PrintMotd yes/PrintMotd no/g' /etc/ssh/sshd_config ``` +Enable the new motd at start session + +``` +sudo echo "/usr/local/bin/coldmotd" > /etc/profile.d/coldmotd.sh +sudo chmod +x /etc/profile.d/coldmotd.sh +``` + +Copy the new motd + +``` +sudo cp motd /usr/local/bin/ +sudo chmod +x /usr/local/bin/motd +``` # FOR ZSH USERS Just add this line "/usr/local/bin/motd" in your ~/.ZSHRC. It's recommanded to add it at the end of the file diff --git a/install.sh b/install.sh deleted file mode 100755 index 7ebb31d..0000000 --- a/install.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -HOMEDIR=$HOME -USERNAME=$(whoami) - -#USE_SUDO='' -if [ $USERNAME != "root" ]; -then - echo "**************************************************" - echo "*YOU HAVE TO RUN THE SCRIPT WITH ROOT PRIVILEGES!*" - echo "**************************************************" -else - -# install the motd -echo "Installing motd..." -cp motd /usr/local/bin/ -cp lxc /usr/local/bin/ - - -#install the maintenance file -cp motd-maint /etc/motd-maint - -#Disable the motd in SSH Server -sed -i 's/#PrintMotd yes/PrintMotd no/g' /etc/ssh/sshd_config -#Enable motd for bash user -echo "/usr/local/bin/motd" > /etc/profile.d/motd.sh -chmod +x /etc/profile.d/motd.sh -# for zsh users -if [ -f "/usr/bin/zsh" ];then -echo "/usr/local/bin/motd" >> ~/.zprofile; -fi -#disable the system motd -echo "" > /etc/motd -chmod +x /usr/local/bin/motd -chmod +x /usr/local/bin/lxc -fi diff --git a/motd b/source/coldmotd similarity index 96% rename from motd rename to source/coldmotd index a1a290e..d774a4c 100644 --- a/motd +++ b/source/coldmotd @@ -1,15 +1,15 @@ #!/bin/bash PROCCOUNT=`ps -Afl | wc -l` PROCCOUNT=`expr $PROCCOUNT - 5` - + uptime=$( Fri, 23 Oct 2015 11:18:00 +0100 + +coldmotd (1.6) stable; urgency=low + + * obsolete ifconfig fixed by ip addr show + + -- Olivier Delort Wed, 21 Oct 2015 00:56:00 +0100 + +coldmotd (1.5) stable; urgency=low + + * back to the first install for zsh users + + -- Olivier Delort Wed, 21 Oct 2015 00:13:00 +0100 + +coldmotd (1.4) stable; urgency=low + + * message for zsh most viewer + + -- Olivier Delort Wed, 21 Oct 2015 00:13:00 +0100 + +coldmotd (1.3) stable; urgency=low + + * pause in postintall file fixed + + -- Olivier Delort Wed, 21 Oct 2015 00:07:00 +0100 + +coldmotd (1.2) stable; urgency=low + + * installation fixed fir zsh users + + -- Olivier Delort Wed, 21 Oct 2015 00:03:00 +0100 + +coldmotd (1.1) stable; urgency=low + + * use space disk for root partition added + * container space disk use for openvz and lxc + + -- Olivier Delort Tue, 20 Oct 2015 23:42:00 +0100 + +coldmotd (1.0) stable; urgency=low + + * new code + * Most simply to configure and install + + -- Olivier Delort Thu, 25 Jun 2015 06:56:00 +0100 + +coldmotd (1.0.1) stable; urgency=low + + * new layout + + -- Olivier Delort Mon, 28 Apr 2014 13:12:00 +0100 + +coldmotd (1.0.0) unstable; urgency=low + + * disk usage deleted + * warning message deleted + * new ascii logo + * first stable version 1.0.0 + + -- Olivier Delort Mon, 28 Apr 2014 13:12:00 +0100 + + +coldmotd (0.1-beta5) unstable; urgency=low + + * new logo. + + + -- Olivier Delort Fri, 21 Mar 2014 14:12:00 +0100 + +coldmotd (0.1-beta4) unstable; urgency=low + + * motd.tcl right configured at the end of the postinst. + + + -- Olivier Delort Fri, 21 Mar 2014 14:12:00 +0100 + +coldmotd (0.1-beta3) unstable; urgency=low + + * fi function was forgoten. + + + -- Olivier Delort Fri, 21 Mar 2014 11:56:00 +0100 + + +coldmotd (0.1-beta2) unstable; urgency=low + + * exit 0 added at the end of the postinst file. + + + -- Olivier Delort Fri, 21 Mar 2014 11:56:00 +0100 + +coldmotd (0.1-beta1) unstable; urgency=low + + * postinst file added to install new bootlogs file. + + + -- Olivier Delort Fri, 21 Mar 2014 10:56:00 +0100 + +coldmotd (0.1) unstable; urgency=low + + * Initial release. + + + -- Olivier Delort Fri, 21 Mar 2014 06:56:00 +0100 diff --git a/source/debian/compat b/source/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/source/debian/compat @@ -0,0 +1 @@ +5 diff --git a/source/debian/control b/source/debian/control new file mode 100644 index 0000000..ecbca1b --- /dev/null +++ b/source/debian/control @@ -0,0 +1,12 @@ +Source: coldmotd +Section: misc +Priority: extra +Maintainer: Olivier Delort +Build-Depends: debhelper (>= 5.0.0) +Standards-Version: 1.7 +Homepage: http://wiki-colmaris.olivierdelort.net + +Package: coldmotd +Architecture: all +Depends: lsb-release +Description: Configuration for the message of the day colmaris's server. diff --git a/source/debian/copyright b/source/debian/copyright new file mode 100644 index 0000000..6219e9b --- /dev/null +++ b/source/debian/copyright @@ -0,0 +1,21 @@ +This package was debianized by Olivier Delort +Fri, 21 Mar 2014 06:59:00 +0100 + +Copyright: + Packaging copyright © 2014 Olivier Delort + Writting copyright © 2014 Olivier Delort + +License: + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/source/debian/postinst b/source/debian/postinst new file mode 100644 index 0000000..8741621 --- /dev/null +++ b/source/debian/postinst @@ -0,0 +1,15 @@ +#!/bin/bash + +#Disable the motd in SSH Server +sed -i 's/#PrintMotd yes/PrintMotd no/g' /etc/ssh/sshd_config +#Enable motd for bash user +echo "/usr/local/bin/coldmotd" > /etc/profile.d/coldmotd.sh +chmod +x /etc/profile.d/coldmotd.sh +# for zsh users +if [ -f "/usr/bin/zsh" ];then +echo "/usr/local/bin/coldmotd" >> ~/.zprofile; +fi +#disable the system motd +echo "" > /etc/motd +chmod +x /usr/local/bin/coldmotd +exit 0 diff --git a/source/debian/rules b/source/debian/rules new file mode 100755 index 0000000..c0bfaa6 --- /dev/null +++ b/source/debian/rules @@ -0,0 +1,36 @@ +#!/usr/bin/make -f + +build: + +build-arch: + +build-indep: + +clean: + dh_testdir + dh_testroot + dh_clean + +install: + dh_install coldmotd /usr/local/bin + dh_install motd-maint /etc/ + dh_install openvz /usr/local/bin + dh_install lxc /usr/local/bin + dh_testdir + dh_testroot +binary-arch: + +binary-indep: install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_fixperms + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch + +.PHONY: clean install binary-arch binary-indep binary diff --git a/lxc b/source/lxc old mode 100644 new mode 100755 similarity index 100% rename from lxc rename to source/lxc diff --git a/motd-maint b/source/motd-maint similarity index 100% rename from motd-maint rename to source/motd-maint diff --git a/old_motd.tcl b/source/old_motd.tcl similarity index 100% rename from old_motd.tcl rename to source/old_motd.tcl diff --git a/openvz b/source/openvz old mode 100644 new mode 100755 similarity index 100% rename from openvz rename to source/openvz