Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###
- # By Rafael 'R@f' Keramidas
- ###
- #!/bin/bash
- # Command to get the download link for the sa-mp linux server archive (Lynx required !).
- LINK=`lynx -dump "http://files.sa-mp.com/?C=M;O=D" | awk '($2 ~ /\.tar\.gz/){print $2}' | head -1`
- # Get the archive name (by removing "http://files.sa-mp.com/".
- ANAME=`echo $LINK | sed 's/.\{23\}//'`
- if [ -z $1 ]
- then
- echo "USAGE: ./samp_install.sh [SERVERNAME]"
- else
- echo "Starting install..."
- # If the download directory does not exist.
- if [ ! -d $DLDIR ]
- then
- # Create the download directory.
- mkdir $DLDIR
- fi
- # Go to the download directory.
- cd $DLDIR
- # Download the archive.
- wget $LINK
- # Untar the archive.
- tar -zxf $ANAME
- # Removing the archive.
- rm $ANAME
- # Move and rename the samp directory
- mv samp03 $1
- # Go to the samp directory
- cd $1
- # Rename the server executable
- mv samp03svr "samp03svr$1"
- echo "Installation finished !"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement