<commit_before>#!/bin/sh
# CrashPlan fix for Synology package upgrades that keep breaking and stopping CrashPlan
# <NAME>
# October 2015
# Usage: Run this and pass the crashplan update number (the long number) as input e.g. curl -Ls <scriptURI> | sh

echo The following upgrades are found:
ls -l /var/packages/CrashPlan/target/upgrade/*.jar

unset upgradenum
if [ -z "$1" ];
then
	echo "No CrashPlan Upgrade Number provided"
	exit 1;
else
	upgradenum="$1" ;
	echo "Processing upgrade $upgradenum"
fi

unzip -o /var/packages/CrashPlan/target/upgrade/${upgradenum}.jar "*.jar" -d /var/packages/CrashPlan/target/lib/
unzip -o /var/packages/CrashPlan/target/upgrade/${upgradenum}.jar "lang/*" -d /var/packages/CrashPlan/target/

upgradedirs=`ls -ld /var/packages/CrashPlan/target/upgrade/${upgradenum}.*/ | wc -l`
upgradedir=`ls -d /var/packages/CrashPlan/target/upgrade/${upgradenum}.*/`
echo Folders to process: $upgradedirs
if [ "${upgradedirs}" -gt 1 ];
then
	echo More than one upgrade directory found. In that case, simply rename upgrade.sh to upgrade.sh.old in each of those directories.
	echo "mv <dir>/upgrade.sh <dir>/upgrade.sh.old 
	echo ${upgradedir}
	exit 1;
fi

echo Processing folder ${upgradedir}
mv ${upgradedir}/upgrade.sh ${upgradedir}/upgrade.sh.old 
echo The contents of /var/lib/crashplan/.ui_info file: `cat /var/lib/crashplan/.ui_info  ; echo`
echo Restart CrashPlan service and check logs.<commit_msg>List upgrades<commit_after>#!/bin/sh
# CrashPlan fix for Synology package upgrades that keep breaking and stopping CrashPlan
# <NAME>
# October 2015
# Usage: Run this and pass the crashplan update number (the long number) as input e.g. curl -Ls <scriptURI> | sh

echo The following upgrades are found:
ls -l /var/packages/CrashPlan/target/upgrade/*.jar

unset upgradenum
if [ -z "$1" ];
then
	echo "No CrashPlan Upgrade Number provided"
	exit 1;
else
	upgradenum="$1" ;
	echo "Processing upgrade $upgradenum"
fi

unzip -o /var/packages/CrashPlan/target/upgrade/${upgradenum}.jar "*.jar" -d /var/packages/CrashPlan/target/lib/
unzip -o /var/packages/CrashPlan/target/upgrade/${upgradenum}.jar "lang/*" -d /var/packages/CrashPlan/target/

upgradedirs=`ls -ld /var/packages/CrashPlan/target/upgrade/${upgradenum}.*/ | wc -l`
upgradedir=`ls -d /var/packages/CrashPlan/target/upgrade/${upgradenum}.*/`
echo Folders to process: $upgradedirs
if [ "${upgradedirs}" -gt 1 ];
then
	echo "More than one upgrade directory. Manually fix files using: mv <dir>/upgrade.sh <dir>/upgrade.sh.old"
	echo ${upgradedir}
	exit 1;
fi

echo Processing folder ${upgradedir}
mv ${upgradedir}/upgrade.sh ${upgradedir}/upgrade.sh.old 
echo The contents of /var/lib/crashplan/.ui_info file: `cat /var/lib/crashplan/.ui_info  ; echo`
echo Restart CrashPlan service and check logs.
{'fraction_non_alphanumeric': 0.13379011900468807, 'fraction_numerical': 0.006491164803461955, 'mean_word_length': 4.386407766990291, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '3047107', 'n_tokens_mistral': 988, 'n_tokens_neox': 945, 'n_words': 283}