Mia mikrh apogohteush
Alexios Chouchoulas
alexios at vennea.demon.co.uk
Fri Feb 28 06:39:38 EET 1997
[script deleted]
Epeidh (a) den eimai kai kanas eksypnos opws lene kai merikoi gnwstoi kai
(b) h glwssa programmatismou ounix (sic) einai dyskolh, ta ekana salata sto
prohgoumeno script, me apotelesma to swap FILE na katagrafetai sto
/etc/fstab opou mpainoun ta swap PARTITIONS.
Bzzzzzt. Xasate 20 bathmous.
Na to diortwmeno script pou prosthetei thn entolh swapon _arxeio_ sto rc
arxeio ths areskeias sas (rythmiste th metablhth rclocal):
#!/bin/bash
# Oi parakatw dyo metablhtes einai gia to Slackware. Sto systhma sas mporei
# na diaferoun.
rclocal=/etc/rc.d/rc.local
swapon=/sbin/swapon
# Elegxoume gia swsth syntaksh
if [ .$1 = . -o .$2 = . ]; then
echo Syntax: $0 swapfile_filespec size_in_MBytes
echo eg $0 /swap/new_swap 16
exit
fi
fname=$1
blocks=$[$2<<10]
# Elegxoume an to arxeio einai absolute filename (dhl arxizei apo to root
# directory).
if [ `echo $fname|cut -b 1` \!= / ]; then
echo You MUST use an absolute filename.
echo For example, \"/boot/swap/new_swap\", NOT just \"new_swap\"
exit
fi
# Den peirazoume arxeia pou yparxoun hdh.
if [ -e $fname ]; then
echo File $fname already exists.
exit
fi
# Ok, fygame.
echo Creating swapfile $fname, $blocks kbytes.
dd if=/dev/zero of=$fname bs=1024 count=$blocks &&
sync && # Afto deixnei na xreiazetai, xmmmm.
mkswap $fname $blocks && sync &&
swapon $fname &&
cp ${rclocal}{,-old} &&
echo $swapon $fname >>$rclocal &&
echo Done, old $rclocal saved as ${rclocal}-old
A.
Alexios Chouchoulas '88 ,88' ,88' alexios at vennea.demon.co.uk
The Unpronouncable One ,o88oooo88ooooo88oo, axc at dcs.ed.ac.uk
==================================================================
For help on using this list (linux-greek-users), send a message to
"majordomo at argeas.argos.hol.gr" with one line of text: "help".
For any problem send e-mail to owner-linux-greek-users
==================================================================
More information about the Linux-greek-users
mailing list