[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
createlinks utility
Red Hat users might want to use the attached script to create symbolic
links to RPMS on mounted ISO images. In just 1.8G you can use the ISO
images for NFS installs, burning CD-R copies, and have easy access to
the RPMS without copying them to your hard drive.
I wrote it for the new Phoebe beta, but it can be easily changed to
support any distribution by altering just four variables.
--Doc
#!/bin/bash
#
# createlinks: A utility to create symbolic links to RPMS on mounted ISO images
#
# This utility assumes there are three mounted ISO images. To facilitate this in
# my system I've added three following lines to my /etc/fstab file:
#
# /<isofilename> /<mountpoint> iso9660 user,noauto,exec,dev,suid,ro,loop 0 0
#
# /pub/Phoebe/iso/phoebe-i386-disc1.iso /mnt/phoebe1 iso9660 user,noauto,exec,dev,suid,ro,loop 0 0
# /pub/Phoebe/iso/phoebe-i386-disc2.iso /mnt/phoebe2 iso9660 user,noauto,exec,dev,suid,ro,loop 0 0
# /pub/Phoebe/iso/phoebe-i386-disc3.iso /mnt/phoebe3 iso9660 user,noauto,exec,dev,suid,ro,loop 0 0
#
# Define and export some environmental variables
#
# Desired target directory
TARGET="/pub/Phoebe"
export TARGET
#
# ISO mount points
MOUNT1="/mnt/phoebe1"
MOUNT2="/mnt/phoebe2"
MOUNT3="/mnt/phoebe3"
export MOUNT1 MOUNT2 MOUNT3
#
# Here we go...
#
cd $MOUNT1/RedHat/RPMS/
for A in `ls *.rpm`
do
ln -s $MOUNT1/RedHat/RPMS/$A $TARGET/$A
done
cd $MOUNT2/RedHat/RPMS/
for B in `ls *.rpm`
do
ln -s $MOUNT2/RedHat/RPMS/$B $TARGET/$B
done
cd $MOUNT3/RedHat/RPMS/
for C in `ls *.rpm`
do
ln -s $MOUNT3/RedHat/RPMS/$C $TARGET/$C
done
#
# Undo the environmental variables before exiting
#
TARGET=
MOUNT1=
MOUNT2=
MOUNT3=
export TARGET MOUNT1 MOUNT2 MOUNT3
#
# end-of-file
-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.