Skip to content
Snippets Groups Projects
Select Git revision
  • 48d649fe675d3e646916c7224e52a6be6582cd63
  • master default protected
  • forbid-save-as
  • upload-via-token
  • moodle-integration
  • patch-double-tap-seek
  • patch_datum_anzeigen
  • patch_raum_anzeigen
  • intros
  • live_sources
  • bootstrap4
  • modules
12 results

profiling.py

Blame
  • 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