Last active
January 12, 2018 16:07
-
-
Save ezaki/69cfa45d1341123538f354e14f1afbdf to your computer and use it in GitHub Desktop.
ConoHa motd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
write_files: | |
- path: /usr/bin/conoha-motd | |
owner: root:root | |
permissions: '0755' | |
content: | | |
#!/bin/sh | |
echo -e "このホストは $(hostname) だよ!\nリソースの状態は\n$(vmstat)\nこんな感じ。\n更新日時は: $(date)だよー" \ | |
| conohasay -c $([ $(($RANDOM % 2)) -eq 0 ] && echo conoha || echo anzu) -s m > /etc/motd | |
chmod 644 /etc/motd | |
runcmd: | |
- curl -sL https://github.com/hironobu-s/conohasay/releases/download/current/conohasay-linux.amd64.gz | zcat > /usr/bin/conohasay | |
- chmod +x /usr/bin/conohasay | |
- echo "*/5 * * * * conoha-motd > /dev/null 2>&1" | crontab - | |
- conoha-motd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
write_files: | |
- path: /usr/bin/conoha-motd | |
owner: root:root | |
permissions: '0755' | |
content: | | |
#!/bin/sh | |
cat <<EOF > /etc/motd | |
________ ________ ________ ________ ___ ___ ________ | |
|\ ____\|\ __ \|\ ___ \|\ __ \|\ \|\ \|\ __ \ | |
\ \ \___|\ \ \|\ \ \ \\ \ \ \ \|\ \ \ \\\ \ \ \|\ \ | |
\ \ \ \ \ \\\ \ \ \\ \ \ \ \\\ \ \ __ \ \ __ \ | |
\ \ \____\ \ \\\ \ \ \\ \ \ \ \\\ \ \ \ \ \ \ \ \ \ | |
\ \_______\ \_______\ \__\\ \__\ \_______\ \__\ \__\ \__\ \__\ | |
\|_______|\|_______|\|__| \|__|\|_______|\|__|\|__|\|__|\|__| | |
ip address: $(hostname -i) | |
Last update: $(date) | |
EOF | |
chmod 644 /etc/motd | |
runcmd: | |
- echo "*/5 * * * * conoha-motd > /dev/null 2>&1" | crontab - | |
- conoha-motd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment