Compare commits

...
Sign in to create a new pull request.

19 commits

Author SHA1 Message Date
Olivier
a8a3533d6b
Update README.md 2024-12-19 17:08:15 +01:00
580261f9a4 wrong word 2019-02-19 14:30:26 +01:00
1826e88e81 not used 2019-02-19 14:21:40 +01:00
1808fb8c3e border root privileges 2019-02-19 14:16:06 +01:00
ce9398d2b0 root again 2019-02-19 14:14:55 +01:00
db05308cba root priviliges 2019-02-19 14:13:15 +01:00
eda1e344c1 Merge branch 'master' of framagit.org:draconis/motd 2019-02-19 14:09:59 +01:00
1c757a1fb3 set environment 2019-02-19 14:09:32 +01:00
b671079a8e executable file 2019-02-19 14:07:01 +01:00
4e90f3f3ef update readme 2019-02-19 14:04:00 +01:00
accca5e2eb new url 2019-02-19 13:50:02 +01:00
2c60e17a82 i don't use openvz anymore 2019-02-19 13:45:04 +01:00
c1d432ecc0 initial commit 2019-02-19 13:43:31 +01:00
ff6e46e708 first code 2019-02-19 13:34:11 +01:00
68d04e41a3 initial commit 2019-02-19 13:27:35 +01:00
f4c3ecc0d6 new motd file name 2019-02-19 13:23:03 +01:00
80fa7d02c3 new location 2019-02-19 13:22:09 +01:00
57f1e9c8e2 new repo url 2019-02-19 13:20:54 +01:00
314997a6ae new screenshot url 2019-02-19 13:19:26 +01:00
13 changed files with 46 additions and 218 deletions

View file

@ -2,41 +2,28 @@
Screenshot
![logo](https://labo.olivierdelort.net/olivier/motd/blob/master/screen_shot.jpg "Screenshot_blank")
![logo](/screen_shot.jpg "Screenshot_blank")
## Configuration :
## Dependencies :
You have to install the rsb-release package to use it.
```
sudo apt-get install lsb-release
sudo apt install lsb-release
```
## Install the developpment release
## Install
```
git clone https://labo.olivierdelort.net/olivier/motd.git
git clone https://github.com/colmaris/Serveur-motd.git
```
Disable the SSH's motd
Execute the installation's script
```
sudo sed -i 's/#PrintMotd yes/PrintMotd no/g' /etc/ssh/sshd_config
sudo sh install.sh
```
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

36
install.sh Executable file
View file

@ -0,0 +1,36 @@
#!/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

0
source/lxc → lxc Executable file → Normal file
View file

View file

@ -1,15 +1,15 @@
#!/bin/bash
PROCCOUNT=`ps -Afl | wc -l`
PROCCOUNT=`expr $PROCCOUNT - 5`
uptime=$(</proc/uptime)
uptime=${uptime%%.*}
seconds=$(( uptime%60 ))
minutes=$(( uptime/60%60 ))
hours=$(( uptime/60/60%24 ))
days=$(( uptime/60/60/24 ))
echo -e "
\033[1;31m+++++++++++++++++: \033[0;37mSystem Data\033[1;31m :+++++++++++++++++++
+ \033[0;37mHostname \033[1;31m= \033[1;32m`hostname`
@ -22,7 +22,6 @@ echo -e "
\033[1;31m+ \033[0;37mMemory Free \033[1;31m= \033[1;32m`free -m |grep Mem: | awk -F " " '{print $4}'` MO
\033[1;31m+ \033[0;37mSwap \033[1;31m= \033[1;32m`free -m | tail -n 1 | awk {'print $2'}` Mb Total | \033[1;32m`free -m | tail -n 1 | awk {'print $4'}` Mb Free | \033[1;32m`free -m | tail -n 1 | awk {'print $3'}` Mb used
\033[1;31m+ \033[0;37mRoot Disk Space \033[1;31m= \033[1;32m`df -h / | awk '{ a = $2 } END { print a }'` Total | \033[1;32m`df -h / | awk '{ a = $3 } END { print a }'` Used | \033[1;32m`df -h / | awk '{ a = $4 } END { print a }'` Free
\033[1;31m+ \033[0;37mOpenVz Space Use \033[1;31m= \033[1;32m`/usr/local/bin/openvz`
\033[1;31m+ \033[0;37mLXC Space Use \033[1;31m= \033[1;32m`/usr/local/bin/lxc`
\033[1;31m+++++++++++++++++: \033[0;37mUser Data\033[1;31m :+++++++++++++++++++++
+ \033[0;37mUsername \033[1;31m= \033[1;32m`whoami`
@ -30,4 +29,3 @@ echo -e "
\033[1;31m+++++++++++++++++: \033[0;37mLast Maintenance\033[1;31m :++++++++++++++
\033[1;32m`tail /etc/motd-maint -n 3`
\033[1;31m+++++++++++++++++++++++++++++++++++++++++++++++++++\033[0m"

0
source/openvz → openvz Executable file → Normal file
View file

View file

@ -1,108 +0,0 @@
coldmotd (1.7) stable; urgency=low
* disable the system message of the day
-- Olivier Delort <courriel@olivierdelort.net> Fri, 23 Oct 2015 11:18:00 +0100
coldmotd (1.6) stable; urgency=low
* obsolete ifconfig fixed by ip addr show
-- Olivier Delort <courriel@olivierdelort.net> Wed, 21 Oct 2015 00:56:00 +0100
coldmotd (1.5) stable; urgency=low
* back to the first install for zsh users
-- Olivier Delort <courriel@olivierdelort.net> Wed, 21 Oct 2015 00:13:00 +0100
coldmotd (1.4) stable; urgency=low
* message for zsh most viewer
-- Olivier Delort <courriel@olivierdelort.net> Wed, 21 Oct 2015 00:13:00 +0100
coldmotd (1.3) stable; urgency=low
* pause in postintall file fixed
-- Olivier Delort <courriel@olivierdelort.net> Wed, 21 Oct 2015 00:07:00 +0100
coldmotd (1.2) stable; urgency=low
* installation fixed fir zsh users
-- Olivier Delort <courriel@olivierdelort.net> 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 <courriel@olivierdelort.net> Tue, 20 Oct 2015 23:42:00 +0100
coldmotd (1.0) stable; urgency=low
* new code
* Most simply to configure and install
-- Olivier Delort <courriel@olivierdelort.net> Thu, 25 Jun 2015 06:56:00 +0100
coldmotd (1.0.1) stable; urgency=low
* new layout
-- Olivier Delort <courriel@olivierdelort.net> 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 <courriel@olivierdelort.net> Mon, 28 Apr 2014 13:12:00 +0100
coldmotd (0.1-beta5) unstable; urgency=low
* new logo.
-- Olivier Delort <courriel@olivierdelort.net> 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 <courriel@olivierdelort.net> Fri, 21 Mar 2014 14:12:00 +0100
coldmotd (0.1-beta3) unstable; urgency=low
* fi function was forgoten.
-- Olivier Delort <courriel@olivierdelort.net> 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 <courriel@olivierdelort.net> 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 <courriel@olivierdelort.net> Fri, 21 Mar 2014 10:56:00 +0100
coldmotd (0.1) unstable; urgency=low
* Initial release.
-- Olivier Delort <courriel@olivierdelort.net> Fri, 21 Mar 2014 06:56:00 +0100

View file

@ -1 +0,0 @@
5

View file

@ -1,12 +0,0 @@
Source: coldmotd
Section: misc
Priority: extra
Maintainer: Olivier Delort <courriel@olivierdelort.net>
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.

View file

@ -1,21 +0,0 @@
This package was debianized by Olivier Delort <courriel@olivierdelort.net>
Fri, 21 Mar 2014 06:59:00 +0100
Copyright:
Packaging copyright © 2014 Olivier Delort <courriel@olivierdelort.net>
Writting copyright © 2014 Olivier Delort <courriel@olivierdelort.net>
License:
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
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.

View file

@ -1,15 +0,0 @@
#!/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

View file

@ -1,36 +0,0 @@
#!/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