Last active
August 29, 2015 14:06
-
-
Save ikorolev93/9d0ab5a82faf416cce91 to your computer and use it in GitHub Desktop.
portage squashfs updater (server part)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
LOG=$(mktemp) | |
( | |
set -e | |
mkdir -p /home/dnt/portage | |
cd /home/dnt/portage | |
wget -N --ignore-length http://mirrors.digitalocean.com/gentoo/snapshots/portage-latest.tar.xz | |
if [ ! -s portage-latest.tar.xz ]; then exit 0; fi | |
tar -xJpf portage-latest.tar.xz | |
mksquashfs portage portage-latest.sqfs -comp xz -force-uid 250 -force-gid 250 -noappend | |
rm -rf portage | |
touch -r portage-latest.tar.xz timestamp | |
truncate -s 0 portage-latest.tar.xz | |
touch -r timestamp portage-latest.tar.xz | |
rm timestamp | |
) >$LOG 2>&1 | |
[ $? -ne 0 ] && cat $LOG | |
rm $LOG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment