madduck's git repository
Every one of the projects in this repository is available at the canonical
URL git://git.madduck.net/madduck/pub/<projectpath> — see
each project's metadata for the exact URL.
All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
SSH access, as well as push access can be individually
arranged.
If you use my repositories frequently, consider adding the following
snippet to ~/.gitconfig and using the third clone URL listed for each
project:
[url "git://git.madduck.net/madduck/"]
insteadOf = madduck:
#
# Adapted from Eridan's "fs" (cleanup, enhancements and switch to bash/Linux)
# JM, 10/12/2004
#
# Adapted from Eridan's "fs" (cleanup, enhancements and switch to bash/Linux)
# JM, 10/12/2004
# Integrated into Lain in september 2013
# https://github.com/copycat-killer/lain
# Integrated into Lain in september 2013
# https://github.com/copycat-killer/lain
# -------------------------------------------------------------------------
# Decoding options
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# Decoding options
# -------------------------------------------------------------------------
-USAGE="Usage: $0 [-h(elp)] | [-n(arrow mode)] | [-w(eb output)]"
+USAGE="Usage: $0 [-h(elp)] | [-n(arrow mode)] | [-w(eb output) | --type=<fstype> | --exclude-type=<fstype>]"
NARROW_MODE=0
WEB_OUTPUT=0
NARROW_MODE=0
WEB_OUTPUT=0
while [ $# -gt 0 ]; do
case "$1" in
while [ $# -gt 0 ]; do
case "$1" in
+--type=*)
+DF_OPTIONS+=" $1"
+;;
+--exclude-type=*)
+DF_OPTIONS+=" $1"
+;;
+# Add additional df options
+DF_COMMAND+=$DF_OPTIONS
+
# -------------------------------------------------------------------------
# Grabbing "df" result
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# Grabbing "df" result
# -------------------------------------------------------------------------
# Computing mount point max length
# -------------------------------------------------------------------------
MOUNT_POINT_MAX_LENGTH=` \
# Computing mount point max length
# -------------------------------------------------------------------------
MOUNT_POINT_MAX_LENGTH=` \
- echo $SORTED_FILE_SYSTEMS_INFO | $AWK_COMMAND -v PATTERN=$PATTERN \
+ echo "$SORTED_FILE_SYSTEMS_INFO" | $AWK_COMMAND -v PATTERN=$PATTERN \
'
BEGIN {
mount_point_length_max = 15;
'
BEGIN {
mount_point_length_max = 15;
current_date = strftime ("%d-%m-%Y @ %H:%M:%S", localtime (systime ()));
free_threshold = 10; # %
current_date = strftime ("%d-%m-%Y @ %H:%M:%S", localtime (systime ()));
free_threshold = 10; # %
- printf ("<!-- DEBUT CONTENU -->\n");
+ printf ("<!-- DEBUT CONTENU -->\n");
printf ( \
"<A NAME=\"top\"></A>\n" \
printf ( \
"<A NAME=\"top\"></A>\n" \
"<TD ALIGN=LEFT><STRONG>Mount point</STRONG></TD>\n" \
"<TD ALIGN=CENTER><STRONG>%% Usato (<SPAN CLASS=\"titleblue\">*</SPAN>)" \
" - %% Free (<SPAN CLASS=\"titlegreen\">*</SPAN>)</STRONG></TD>\n" \
"<TD ALIGN=LEFT><STRONG>Mount point</STRONG></TD>\n" \
"<TD ALIGN=CENTER><STRONG>%% Usato (<SPAN CLASS=\"titleblue\">*</SPAN>)" \
" - %% Free (<SPAN CLASS=\"titlegreen\">*</SPAN>)</STRONG></TD>\n" \
- "<TD ALIGN=CENTER><STRONG>%% Usato</STRONG></TD>\n" \
- "<TD ALIGN=CENTER><STRONG>Spazio libero</STRONG></TD>\n" \
- "<TD ALIGN=CENTER><STRONG>Spazio totale</STRONG></TD>\n" \
+ "<TD ALIGN=CENTER><STRONG>%% Used</STRONG></TD>\n" \
+ "<TD ALIGN=CENTER><STRONG>Free</STRONG></TD>\n" \
+ "<TD ALIGN=CENTER><STRONG>Total</STRONG></TD>\n" \
printf ("\n%s", narrow_margin);
else
printf ("%-*s", LEFT_COLUMN + 2, "");
printf ("\n%s", narrow_margin);
else
printf ("%-*s", LEFT_COLUMN + 2, "");
- print " Used Free Total ";
+ print " Used Free Total ";
# printf ("stars_number = %d\n", stars_number);
printf ("|");
# printf ("stars_number = %d\n", stars_number);
printf ("|");
- for (i = 1; i <= stars_number; i++)
+ for (i = 1; i <= stars_number && i <= 49; i++)
if (total_size > 1 * t_bytes)
printf ( \
if (total_size > 1 * t_bytes)
printf ( \
- "| %3d%% %5.1f %5.1f Tb\n", \
+ "| %3d%% %6.1f %6.1f Tb\n", \
percentage_occupied, free_size / t_bytes, total_size / t_bytes \
);
else if (total_size > 1 * g_bytes)
printf ( \
percentage_occupied, free_size / t_bytes, total_size / t_bytes \
);
else if (total_size > 1 * g_bytes)
printf ( \
- "| %3d%% %5.1f %5.1f Gb\n", \
+ "| %3d%% %6.1f %6.1f Gb\n", \
percentage_occupied, free_size / g_bytes, total_size / g_bytes \
);
else if (total_size > 1 * m_byptes)
printf ( \
percentage_occupied, free_size / g_bytes, total_size / g_bytes \
);
else if (total_size > 1 * m_byptes)
printf ( \
- "| %3d%% %5.1f %5.1f Mb\n", \
+ "| %3d%% %6.1f %6.1f Mb\n", \
percentage_occupied, free_size / m_bytes, total_size / m_bytes \
);
else
printf ( \
percentage_occupied, free_size / m_bytes, total_size / m_bytes \
);
else
printf ( \
- "| %3d%% %5.1f %5.1f Kb\n", \
+ "| %3d%% %6.1f %6.1f Kb\n", \
percentage_occupied, free_size / k_bytes, total_size / k_bytes \
);
}
percentage_occupied, free_size / k_bytes, total_size / k_bytes \
);
}