<commit_before>#!/bin/bash

# temperature
# outputs the temperature information

# requires the following packages
# hddtemp
# lm-sensors

# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi

sensors
sudo hddtemp /dev/sd{b,c,d}
<commit_msg>Rewrote temperature.sh to check packages and devices<commit_after>#!/bin/bash

# temperature.sh
# outputs the temperature information

# Ensure commands are available
type -P sensors 2>&1 > /dev/null || sudo apt-get install lm-sensors
type -P hddtemp 2>&1 > /dev/null || sudo apt-get install hddtemp

# Run appropriate commands
sudo sensors
[ -e /dev/sdb ] && sudo hddtemp /dev/sdb
[ -e /dev/sdc ] && sudo hddtemp /dev/sdc
[ -e /dev/sdd ] && sudo hddtemp /dev/sdd

{'fraction_non_alphanumeric': 0.12244897959183673, 'fraction_numerical': 0.01020408163265306, 'mean_word_length': 3.6449704142011834, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6111453', 'n_tokens_mistral': 286, 'n_tokens_neox': 266, 'n_words': 95}