]> err.no Git - dotfiles/commitdiff
add blogging support
authortfheen <tfheen@8da78d58-1cd3-0310-bee5-d77bd1b3e8bf>
Sun, 4 Jan 2004 02:42:52 +0000 (02:42 +0000)
committertfheen <tfheen@8da78d58-1cd3-0310-bee5-d77bd1b3e8bf>
Sun, 4 Jan 2004 02:42:52 +0000 (02:42 +0000)
git-svn-id: file:///svn/tfheen/trunk/dotfiles@252 8da78d58-1cd3-0310-bee5-d77bd1b3e8bf

environment

index 8ff05325aacb2ecf428d79954393b25514e54896..800f3b0f67a2c789b5cb1f21fac74429c09f11cf 100644 (file)
@@ -10,6 +10,26 @@ if [ `uname -s` = "FreeBSD" ] && alias | grep -q "alias ls"; then
     unalias ls
 fi
 
+blog () {
+    if [ "$HOSTNAME" != "vawad.raw.no" ]; then
+        echo "You are not on vawad!"
+        return 1
+    fi
+    if [ -z "$1" ]; then
+        CAT="$1"
+    else
+        CAT="/"
+    fi
+
+    if [ -z "$2" ]; then
+        SUBJ="$(echo $2 | tr ' ' '_')"
+    else
+        SUBJ="blank_subject"
+    fi
+
+    $EDITOR $HOME/blog/$CAT/$(date +"%Y-%m-%d-%H-%M")_$SUBJ
+}
+
 is_debian () {
     if [ -f /etc/debian_version ]; then
         return 0