if [ ! "$(grep /tmp /etc/fstab)" ]; then
  if [ ! -e "/var/fuduntu/ramdisk" ]; then
    echo -n " RAMDISK"
    /etc/init.d/rsyslog stop 2>/dev/null || true
    echo "tmpfs /tmp     tmpfs defaults,noatime,mode=1777 0 0" >>/etc/fstab
    echo "tmpfs /var/log tmpfs defaults,noatime,mode=0755 0 0" >>/etc/fstab
    mv /tmp /tmp2 2>/dev/null || true
    mkdir /tmp 2>/dev/null || true
    mv /var/log /var/log2 2>/dev/null || true
    mkdir /var/log 2>/dev/null || true
    chmod 1777 /tmp 2>/dev/null || true
    mount /tmp 2>/dev/null || true
    mount /var/log 2>/dev/null || true
    chmod 1777 /tmp 2>/dev/null || true
    rsync -av /tmp2/ /tmp >/dev/null 2>&1 || true
    rsync -av /var/log2/ /var/log >/dev/null 2>&1 || true
    rm -rf /tmp2 2>/dev/null || true
    rm -rf /var/log2 2>/dev/null || true
    /etc/init.d/rsyslog start 2>/dev/null || true

    ### Alter logrotate to compensate for syslog changes
    sed -i "s#weekly#daily#" /etc/logrotate.conf 2>/dev/null || true
    sed -i "s#rotate 4#rotate 1#" /etc/logrotate.conf 2>/dev/null || true
    sed -i "s#\#compress#compress#" /etc/logrotate.conf 2>/dev/null || true
    touch /var/fuduntu/ramdisk
    fi
fi
