#!/bin/bash
file="Markdown.md";

# List active users
awk -F ":" '{ if ( $2 != "*" && $2 != "!" ) print $1 }' "/etc/shadow" > "/tmp/active_users";

# List active users directories
awk -f "/etc/richstyle/compare.awk" "/tmp/active_users" "/etc/passwd" > "/tmp/active_users_dirs";

# Remove file from active users directories
for d in $(cat "/tmp/active_users_dirs");
do
	if [ -d $d ];
	then
		rm $d"/Templates/"$file ;
	fi
done

# Remove temporary files
rm "/tmp/active_users";
rm "/tmp/active_users_dirs";

# Remove minified CSS file

rm "/usr/share/css/richstyle/richstyle.min.css";

# Remove the link to `cc-icons`

rm "/usr/share/css/richstyle/cc-icons";

