|
|
@ -69,63 +69,66 @@ elif [ "$1" = 'doupdate' ]; then
|
|
|
|
DEBIAN_FRONTEND='kde' apt-get -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' -o Apt::Color='0' -o Dpkg::Use-Pty='0' -y dist-upgrade |& tee /run/lubuntu-update-apt-log
|
|
|
|
DEBIAN_FRONTEND='kde' apt-get -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' -o Apt::Color='0' -o Dpkg::Use-Pty='0' -y dist-upgrade |& tee /run/lubuntu-update-apt-log
|
|
|
|
|
|
|
|
|
|
|
|
# Find all the conffiles
|
|
|
|
# Find all the conffiles
|
|
|
|
|
|
|
|
doConffiles='y';
|
|
|
|
mapfile conffileRawList <<< "$(grep -P "^Configuration file \'.*\'$" '/run/lubuntu-update-apt-log')"
|
|
|
|
mapfile conffileRawList <<< "$(grep -P "^Configuration file \'.*\'$" '/run/lubuntu-update-apt-log')"
|
|
|
|
if [ "$(echo "${conffileRawList[0]}" | head -c1)" != 'C' ]; then # Empty or invalid list, we're done
|
|
|
|
if [ "$(echo "${conffileRawList[0]}" | head -c1)" != 'C' ]; then # Empty or invalid list, we're done
|
|
|
|
exit 0
|
|
|
|
doConffiles='n';
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
conffileList=()
|
|
|
|
if [ "$doConffiles" = 'y' ]; then
|
|
|
|
counter=0
|
|
|
|
conffileList=()
|
|
|
|
while [ "$counter" -lt "${#conffileRawList[@]}" ]; do
|
|
|
|
counter=0
|
|
|
|
# Cut off "Configuration file '" from the start and "'" plus a couple trailing characters from the end
|
|
|
|
while [ "$counter" -lt "${#conffileRawList[@]}" ]; do
|
|
|
|
conffileList[counter]="$(echo "${conffileRawList[$counter]}" | tail -c+21 | head -c-3)"
|
|
|
|
# Cut off "Configuration file '" from the start and "'" plus a couple trailing characters from the end
|
|
|
|
counter=$((counter+1))
|
|
|
|
conffileList[counter]="$(echo "${conffileRawList[$counter]}" | tail -c+21 | head -c-3)"
|
|
|
|
done
|
|
|
|
counter=$((counter+1))
|
|
|
|
|
|
|
|
done
|
|
|
|
echo "Lubuntu Update !!! CONFIGURATION FILE LIST START";
|
|
|
|
|
|
|
|
counter=0
|
|
|
|
echo "Lubuntu Update !!! CONFIGURATION FILE LIST START";
|
|
|
|
while [ "$counter" -lt "${#conffileList[@]}" ]; do
|
|
|
|
counter=0
|
|
|
|
echo "${conffileList[$counter]}"
|
|
|
|
while [ "$counter" -lt "${#conffileList[@]}" ]; do
|
|
|
|
counter=$((counter+1))
|
|
|
|
echo "${conffileList[$counter]}"
|
|
|
|
done
|
|
|
|
counter=$((counter+1))
|
|
|
|
echo "Lubuntu Update !!! CONFIGURATION FILE LIST END";
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "Lubuntu Update !!! CONFIGURATION FILE LIST END";
|
|
|
|
# If we make it this far, there were conffiles to deal with
|
|
|
|
|
|
|
|
breakLoop='no'
|
|
|
|
# If we make it this far, there were conffiles to deal with
|
|
|
|
gotCommand='no'
|
|
|
|
breakLoop='no'
|
|
|
|
commandName=''
|
|
|
|
gotCommand='no'
|
|
|
|
while [ "$breakLoop" = 'no' ]; do
|
|
|
|
commandName=''
|
|
|
|
read -r inputVal
|
|
|
|
while [ "$breakLoop" = 'no' ]; do
|
|
|
|
if [ "$gotCommand" = 'no' ]; then
|
|
|
|
read -r inputVal
|
|
|
|
if [ "$inputVal" = 'done' ]; then
|
|
|
|
if [ "$gotCommand" = 'no' ]; then
|
|
|
|
breakLoop='yes'
|
|
|
|
if [ "$inputVal" = 'done' ]; then
|
|
|
|
|
|
|
|
breakLoop='yes'
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
commandName="$inputVal"
|
|
|
|
|
|
|
|
gotCommand='yes'
|
|
|
|
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
else
|
|
|
|
commandName="$inputVal"
|
|
|
|
if [ "$commandName" = 'replace' ]; then # Replace an existing file
|
|
|
|
gotCommand='yes'
|
|
|
|
counter=0
|
|
|
|
fi
|
|
|
|
while [ "$counter" -lt "${#conffileList[@]}" ]; do
|
|
|
|
else
|
|
|
|
if [ "$inputVal" = "${conffileList[$counter]}" ]; then
|
|
|
|
if [ "$commandName" = 'replace' ]; then # Replace an existing file
|
|
|
|
mv "$inputVal.dpkg-dist" "$inputVal"
|
|
|
|
counter=0
|
|
|
|
break
|
|
|
|
while [ "$counter" -lt "${#conffileList[@]}" ]; do
|
|
|
|
fi
|
|
|
|
if [ "$inputVal" = "${conffileList[$counter]}" ]; then
|
|
|
|
counter=$((counter+1))
|
|
|
|
mv "$inputVal.dpkg-dist" "$inputVal"
|
|
|
|
done
|
|
|
|
break
|
|
|
|
elif [ "$commandName" = 'keep' ]; then # Keep an existing file
|
|
|
|
fi
|
|
|
|
counter=0
|
|
|
|
counter=$((counter+1))
|
|
|
|
while [ "$counter" -lt "${#conffileList[@]}" ]; do
|
|
|
|
done
|
|
|
|
if [ "$inputVal" = "${conffileList[$counter]}" ]; then
|
|
|
|
elif [ "$commandName" = 'keep' ]; then # Keep an existing file
|
|
|
|
rm "$inputVal.dpkg-dist"
|
|
|
|
counter=0
|
|
|
|
break
|
|
|
|
while [ "$counter" -lt "${#conffileList[@]}" ]; do
|
|
|
|
fi
|
|
|
|
if [ "$inputVal" = "${conffileList[$counter]}" ]; then
|
|
|
|
counter=$((counter+1))
|
|
|
|
rm "$inputVal.dpkg-dist"
|
|
|
|
done
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
gotCommand='no'
|
|
|
|
counter=$((counter+1))
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
gotCommand='no'
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo 'Checking release status...'
|
|
|
|
echo 'Checking release status...'
|
|
|
|
|
|
|
|
|
|
|
@ -133,36 +136,52 @@ elif [ "$1" = 'doupdate' ]; then
|
|
|
|
releaseYear="$(cut -d'.' -f1 <<< "$releaseCode")";
|
|
|
|
releaseYear="$(cut -d'.' -f1 <<< "$releaseCode")";
|
|
|
|
releaseMonth="$(cut -d'.' -f2 <<< "$releaseCode")";
|
|
|
|
releaseMonth="$(cut -d'.' -f2 <<< "$releaseCode")";
|
|
|
|
metaReleaseData="$(curl https://changelogs.ubuntu.com/meta-release)";
|
|
|
|
metaReleaseData="$(curl https://changelogs.ubuntu.com/meta-release)";
|
|
|
|
nextReleaseMonth='';
|
|
|
|
#nextReleaseMonth='';
|
|
|
|
nextReleaseYear='';
|
|
|
|
#nextReleaseYear='';
|
|
|
|
nextLTSReleaseMonth='';
|
|
|
|
#nextLTSReleaseMonth='';
|
|
|
|
nextLTSReleaseYear='';
|
|
|
|
#nextLTSReleaseYear='';
|
|
|
|
|
|
|
|
|
|
|
|
if ((releaseMonth == 4)); then
|
|
|
|
while true; do
|
|
|
|
nextReleaseMonth=((releaseMonth + 6));
|
|
|
|
if ((releaseMonth == 4)); then
|
|
|
|
nextReleaseYear="$releaseYear";
|
|
|
|
releaseMonth='10';
|
|
|
|
if (((releaseYear % 2) == 0)); then
|
|
|
|
else
|
|
|
|
nextLTSReleaseMonth='04';
|
|
|
|
releaseMonth='04';
|
|
|
|
nextLTSReleaseYear=((releaseYear + 2));
|
|
|
|
((releaseYear++));
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
if isReleaseSupported "$releaseYear" "$releaseMonth" "$metaReleaseData"; then
|
|
|
|
nextReleaseMonth="$releaseMonth";
|
|
|
|
|
|
|
|
nextReleaseYear=((releaseYear + 1));
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ -n "$nextLTSReleaseYear" ]; then
|
|
|
|
|
|
|
|
if isReleaseSupported "$nextLTSReleaseYear" "$nextLTSReleaseMonth" "$metaReleaseData"; then
|
|
|
|
|
|
|
|
echo 'Lubuntu Update !!! NEW RELEASE';
|
|
|
|
echo 'Lubuntu Update !!! NEW RELEASE';
|
|
|
|
echo "$nextLTSReleaseYear.$nextLTSReleaseMonth";
|
|
|
|
echo "$releaseYear.$releaseMonth";
|
|
|
|
|
|
|
|
break;
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
if ! (((nextReleaseYear == nextLTSReleaseYear) && (nextReleaseMonth == nextLTSReleaseMonth))); then
|
|
|
|
# if ((releaseMonth == 4)); then
|
|
|
|
if isReleaseSupported "$nextReleaseYear" "$nextReleaseMonth" "$metaReleaseData"; then
|
|
|
|
# nextReleaseMonth=$((releaseMonth + 6));
|
|
|
|
echo 'Lubuntu Update !!! NEW RELEASE';
|
|
|
|
# nextReleaseYear="$releaseYear";
|
|
|
|
echo "$nextReleaseYear.$nextReleaseMonth";
|
|
|
|
# if (((releaseYear % 2) == 0)); then
|
|
|
|
fi
|
|
|
|
# nextLTSReleaseMonth='04';
|
|
|
|
fi
|
|
|
|
# nextLTSReleaseYear=$((releaseYear + 2));
|
|
|
|
|
|
|
|
# fi
|
|
|
|
|
|
|
|
# else
|
|
|
|
|
|
|
|
# nextReleaseMonth="$releaseMonth";
|
|
|
|
|
|
|
|
# nextReleaseYear=$((releaseYear + 1));
|
|
|
|
|
|
|
|
# fi
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
# if [ -n "$nextLTSReleaseYear" ]; then
|
|
|
|
|
|
|
|
# if isReleaseSupported "$nextLTSReleaseYear" "$nextLTSReleaseMonth" "$metaReleaseData"; then
|
|
|
|
|
|
|
|
# echo 'Lubuntu Update !!! NEW RELEASE';
|
|
|
|
|
|
|
|
# echo "$nextLTSReleaseYear.$nextLTSReleaseMonth";
|
|
|
|
|
|
|
|
# fi
|
|
|
|
|
|
|
|
# fi
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
# if ! (((nextReleaseYear == nextLTSReleaseYear) && (nextReleaseMonth == nextLTSReleaseMonth))); then
|
|
|
|
|
|
|
|
# if isReleaseSupported "$nextReleaseYear" "$nextReleaseMonth" "$metaReleaseData"; then
|
|
|
|
|
|
|
|
# echo 'Lubuntu Update !!! NEW RELEASE';
|
|
|
|
|
|
|
|
# echo "$nextReleaseYear.$nextReleaseMonth";
|
|
|
|
|
|
|
|
# else
|
|
|
|
|
|
|
|
# echo "Unsupported release: $nextReleaseYear.$nextReleaseMonth";
|
|
|
|
|
|
|
|
# fi
|
|
|
|
|
|
|
|
# fi
|
|
|
|
|
|
|
|
|
|
|
|
echo 'Update installation complete.'
|
|
|
|
echo 'Update installation complete.'
|
|
|
|
elif [ "$1" = 'doReleaseUpgrade' ]; then
|
|
|
|
elif [ "$1" = 'doReleaseUpgrade' ]; then
|
|
|
|