Set of scripts, Ansible playbooks/roles, and other tools to automate and manage FOSS@MAGIC infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
2.0 KiB

# Author: Justin W. Flory <me [at] justinwflory [dot] com>
# Language: Shell
# Filename:
# Description:
# Automatically fixes the One Laptop per Child (OLPC)
# XO laptops to use correct repository files for its
# version of Fedora. For the HFOSS course at the
# Rochester Institute of Technology, most of the XOs
# are running Fedora 18. This script targets setting
# up the EoL (end-of-life) repos for the sake of the
# laptop.
# License:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at
# Bash configuration
set -euxo pipefail
# Environment variables
# Make our working space
if [ ! -d "$TMPDIR" ]; then
echo "Working directory does not exist, making temporary directory..."
mkdir $TMPDIR
# Pull down obsolete keys for Fedora 18 and import
curl -L -O
curl -L -O
sudo rpm --import DE7F38BD.txt && rm DE7F38BD.txt
sudo rpm --import A4D647E9.txt && rm A4D647E9.txt
# Get the new repo files and replace the old ones
curl -L -O
curl -L -O
if [ -d $YUM_REPOS_DIR/fedora.repo ]; then
sudo rm $YUM_REPOS_DIR/fedora.repo
if [ -d $YUM_REPOS_DIR/fedora-updates.repo ]; then
sudo rm $YUM_REPOS_DIR/fedora-updates.repo
sudo mv fedora.repo $YUM_REPOS_DIR
sudo mv fedora-updates.repo $YUM_REPOS_DIR
# Clean up, print out
if [ "$(ls -A $TMPDIR)" ]; then
echo "Directory is not empty. Leaving."
rmdir $TMPDIR
echo "Your repos should be fixed! Try 'sudo yum install git' to try it out."