Select Git revision
profiling.py
Forked from
Video AG Infrastruktur / website
Source project has a limited visibility.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
liprepoctl.sh 1.24 KiB
#!/bin/bash
ACTION="$1"
FILENAME="/etc/apt/sources.list.d/lipoffline.list"
ONLINEFILENAME="/etc/apt/sources.list.d/liponline.list"
ACTIVATED=`test -e "$FILENAME"`
. /etc/lsb-release
DIST_CODENAME=$DISTRIB_CODENAME
DIST_VERSION=$DISTRIB_RELEASE
function install_repo()
{
echo "# offline repository of the linux install party
deb [ arch=amd64 trusted=yes ] file://$1/archives-$DIST_CODENAME $DIST_CODENAME lip" > "$FILENAME"
echo "deb http://ftp.halifax.rwth-aachen.de/ubuntu/ impish main restricted universe multiverse
deb http://ftp.halifax.rwth-aachen.de/ubuntu/ impish-security main restricted universe multiverse
deb http://ftp.halifax.rwth-aachen.de/ubuntu/ impish-updates main restricted universe multiverse" > "$ONLINEFILENAME"
}
function uninstall_repo()
{
rm -f "$FILENAME" "$ONLINEFILENAME"
}
case $ACTION in
"on")
if [ -z "$2" ]; then
echo "No repository location specified!"
exit 2
fi
install_repo "$2"
apt-get -o "Dir::Etc::SourceList=$FILENAME" update
echo "Repository is now active, remember to call \"$0 off\" to deactivate it when you are done."
;;
"off")
uninstall_repo
apt-get update
echo "Repository is now inactive."
;;
"check")
echo "State: $ACTIVATED"
;;
*)
echo "Unknown action $ACTION"
exit 1
;;
esac