Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- MEMSIZE=200M
- mounted=false
- . /sbin/functions.sh
- mounttmpfs() {
- mount -t tmpfs tmpfs -o size=$MEMSIZE /var/tmp/portage
- mounted="true"
- }
- compile() {
- einfo "emerging ${*}"
- emerge ${*}
- }
- unmount() {
- ebegin "unmounting tmpfs"
- umount -f /var/tmp/portage
- eend $?
- }
- ebegin "Mounting $MEMSIZE of memory to /var/tmp/portage"
- if [ -z "$(mount | grep /var/tmp/portage)" ]
- then
- mounttmpfs
- else
- eerror "tmpfs already mounted!"
- exit 0
- fi
- eend $?
- compile ${*}
- if [ -n "$mounted" ]
- then
- unmount
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement