Script to keep Slackware up to date with slackpkg

#!/bin/sh
# slackup.sh
# script for keeping your slackware installation up to date with slackpkg

echo -e "Preparing to update your Slackware installation with slackpkg."
echo -e "Do you have a mirror selected for slackpkg to use? [Y/n]: \c"
read -n1 x

case $x
in
  y|Y|'') cat /etc/slackpkg/blacklist
          echo -e "Do you need to edit /etc/slackpkg/blacklist? [y/N]: \c"
          read -n1 x
          case $x
          in
            n|N|'') echo "Running 'slackpkg update'";;
            y|Y|*) $EDITOR /etc/slackpkg/blacklist;;
          esac;;
  n|N|*)  slackpkg update gpg
          $EDITOR /etc/slackpkg/mirrors;;
esac
slackpkg update

echo -e "Did the above execute successfully? [Y/n]: \c"
read -n1 x

case $x
in
  y|Y|'') echo -e "Great. Now we're going to run slackpkg install-new.."
          sleep 2
          slackpkg install-new;;
  n|N|*)  echo -e "Fnord! Come back when it's fixed."
          exit;;
esac

echo -e "Did the above execute successfully? [Y/n]: \c"
read -n1 x

case $x
in
  y|Y|'') echo -e "Great! Now we're going to run slackpkg upgrade-all.."
          sleep 2
          slackpkg upgrade-all;;
  n|N|*)  echo -e "Fnord! Come back when it's fixed."
          exit;;
esac

echo -e "Did the above execute successfully? [Y/n]: \c"
read -n1 x
case $x
in
  y|Y|'') echo -e "All done. Thanks for playing!";;
  n|N|*)  echo -e "Fnord! Come back when it's fixed."
          exit;;
esac

Leave a Reply

Your email address will not be published.