Created
September 11, 2013 14:49
-
-
Save neomelonas/6524718 to your computer and use it in GitHub Desktop.
Move demos from the directory the tf2 server creates them to somewhere accessible to the webserver
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/bash | |
# demomover - move demos from the directory the server creates them in | |
# to somewhere accessible to the webserver. | |
# edit these. fuser can be located in /sbin/ or /bin/ | |
TF_PATH=/absolute/path/to/tf/demos | |
WWW_PATH=/path/to/webserver/demos/ | |
FUSER_BIN=/bin/fuser | |
cd $TF_PATH | |
for file in $(ls | grep "\.dem") | |
do | |
$FUSER_BIN $file >/dev/null 2>&1 | |
if [ $? -eq 1 ] | |
then | |
mv $file $WWW_PATH$j | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment