Skip to content

Instantly share code, notes, and snippets.

@neomelonas
Created September 11, 2013 14:49
Show Gist options
  • Save neomelonas/6524718 to your computer and use it in GitHub Desktop.
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
#!/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