major script cleanup

This commit is contained in:
James Tomasino 2018-12-12 15:09:26 -05:00
parent 66a7f7c6a2
commit 678e69e5e9
19 changed files with 25 additions and 101 deletions

23
Makefile Normal file
View File

@ -0,0 +1,23 @@
install: bin templates man completion
clean:
stow -t "/usr/local/bin" -D bin
stow -t "/etc/templates" -D templates
stow -t "/usr/share/man/man1/" -D man
bin:
stow -t "/usr/local/bin" bin
templates:
mkdir -p "/etc/templates"
stow -t "/etc/templates" templates
man:
mkdir -p "/usr/share/man/man1"
stow -t "/usr/share/man/man1" man
completion:
mkdir -p "/etc/bash_completion.d"
stow -t "/etc/bash_completion.d" completion
.PHONY: bin templates man completion

View File

@ -1,2 +0,0 @@
#!/bin/sh
/usr/games/lolcat /etc/rules

View File

@ -47,8 +47,8 @@ if [ "$run_user" -eq 0 ]; then
# Clear web folder
rm -rf "${html_dir:-/var/www/html}/*"
# Generate RSS
# shellcheck source=cosmic-rss
. "${SCRIPTPATH}/cosmic-rss"
# shellcheck source=rss
. "${SCRIPTPATH}/rss"
# prep directories
mkdir -p "$(dirname "${log_html}")"

View File

@ -1,20 +0,0 @@
Silly Rules:
Rule #1
Don't blow up Earth unless you want everyone in your story to
have a goatee.
Rule #2
If someone talks about you in IRC with ---nick--- then you can't
see it. No really. Stop seeing it.
------
Real Rule:
Don't step on other people's stories with your own. It's a big
'verse and there's room for everyone. If you want to do something
major that will impact another user's story, talk first.

View File

@ -1,77 +0,0 @@
#!/bin/sh
# Get Path to script folder
DIR="$( cd "$( dirname "$0" )" && pwd )"
# Fix path in case of symlinks
DIR=$(cd "$DIR" && pwd -P)
# Admin commands
if [ ! -L "/usr/local/bin/cosmic-user" ]; then
ln -s "${DIR}/bin/cosmic-user" "/usr/local/bin/cosmic-user"
fi
if [ ! -L "/usr/local/bin/cosmic-rmship" ]; then
ln -s "${DIR}/bin/cosmic-rmship" "/usr/local/bin/cosmic-rmship"
fi
if [ ! -L "/usr/local/bin/cosmic-mvship" ]; then
ln -s "${DIR}/bin/cosmic-mvship" "/usr/local/bin/cosmic-mvship"
fi
# User runnable commands
if [ ! -L "/usr/local/bin/cosmic-roster" ]; then
ln -s "${DIR}/bin/cosmic-roster" "/usr/local/bin/cosmic-roster"
fi
if [ ! -L "/usr/local/bin/roster" ]; then
ln -s "${DIR}/bin/cosmic-roster" "/usr/local/bin/roster"
fi
if [ ! -L "/usr/local/bin/motd" ]; then
ln -s "${DIR}/bin/cosmic-motd" "/usr/local/bin/motd"
fi
if [ ! -L "/usr/local/bin/rules" ]; then
ln -s "${DIR}/bin/cosmic-rules" "/usr/local/bin/rules"
fi
if [ ! -L "/usr/local/bin/log" ]; then
ln -s "${DIR}/bin/cosmic-log" "/usr/local/bin/log"
fi
if [ ! -L "/usr/local/bin/cosmic-ship" ]; then
ln -s "${DIR}/bin/cosmic-ship" "/usr/local/bin/cosmic-ship"
fi
if [ ! -L "/usr/local/bin/cosmic-rss" ]; then
ln -s "${DIR}/bin/cosmic-rss" "/usr/local/bin/cosmic-rss"
fi
if [ ! -L "/usr/local/bin/cosmic-web" ]; then
ln -s "${DIR}/bin/cosmic-web" "/usr/local/bin/cosmic-web"
fi
if [ ! -L "/usr/local/bin/latest" ]; then
ln -s "${DIR}/bin/cosmic-latest" "/usr/local/bin/latest"
fi
if [ ! -L "/usr/local/bin/wiki" ]; then
ln -s "${DIR}/bin/cosmic-wiki" "/usr/local/bin/wiki"
fi
if [ ! -L "/usr/local/bin/faq" ]; then
ln -s "${DIR}/bin/cosmic-faq" "/usr/local/bin/faq"
fi
if [ ! -L "/usr/local/bin/qec" ]; then
ln -s "${DIR}/bin/cosmic-qec" "/usr/local/bin/qec"
fi
# Files
if [ ! -L "/etc/welcomemail.tmpl" ]; then
ln -s "${DIR}/templates/welcomemail.tmpl" "/etc/welcomemail.tmpl"
fi
if [ ! -L "/etc/newship.tmpl" ]; then
ln -s "${DIR}/templates/newship.tmpl" "/etc/newship.tmpl"
fi
if [ ! -L "/etc/rules" ]; then
ln -s "${DIR}/files/rules" "/etc/rules"
fi
# Manpages
if [ ! -L "/usr/share/man/man1/log.1" ]; then
ln -s "${DIR}/man/cosmic-log.1" "/usr/share/man/man1/log.1"
fi
# BASH completion
if [ ! -L "/etc/bash_completion.d/log" ]; then
ln -s "${DIR}/completion/cosmic-log.d" "/etc/bash_completion.d/log"
chmod 644 "/etc/bash_completion.d/log"
fi