added shell script and systemctl service for moving encaps edited files to stripper folder and for sending from stripper folder to his chroot jail
This commit is contained in:
parent
bc5f212265
commit
923d46635e
41
file_mover/encap_stripper_mover.sh
Normal file
41
file_mover/encap_stripper_mover.sh
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
upload_dir="/home/test/home/stripper_files/upload"
|
||||||
|
stripper_dir="/home/gameservers/css_ze/cstrike/addons/stripper/maps"
|
||||||
|
maps_dir="/home/test/home/stripper_files/maps"
|
||||||
|
|
||||||
|
# Check if the source directory exists
|
||||||
|
if [ -d "$upload_dir" ]; then
|
||||||
|
for file in "$upload_dir"/*; do
|
||||||
|
if [ -f "$file" ]; then
|
||||||
|
# Move each file to the destination directory
|
||||||
|
chown gameservers:gameservers "$file"
|
||||||
|
chmod 775 "$file"
|
||||||
|
mv "$file" "$stripper_dir/"
|
||||||
|
echo "File '$file' moved successfully."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ -d "$stripper_dir" ]; then
|
||||||
|
for file in "$stripper_dir"/*; do
|
||||||
|
if [ -f "$file" ]; then
|
||||||
|
#copy each file to maps_dir
|
||||||
|
cp --force "$file" "$maps_dir/"
|
||||||
|
echo "File '$file' moved successfully."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d "$maps_dir" ]; then
|
||||||
|
for file in "$maps_dir"/*; do
|
||||||
|
if [ -f "$file" ]; then
|
||||||
|
#copy each file to maps_dir
|
||||||
|
chown stripper_files:stripper_files "$file"
|
||||||
|
chmod 775 "$file"
|
||||||
|
echo "File '$file' modified successfully."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
10
file_mover/systemctl/encap_stripper_mover.service
Normal file
10
file_mover/systemctl/encap_stripper_mover.service
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Moves stripper files from /home/test/home/stripper_files/upload to the css ze servers stripper/maps dir
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=root
|
||||||
|
WorkingDirectory=/home/test/home/stripper_files
|
||||||
|
ExecStart=/home/test/home/stripper_files/encap_stripper_mover.sh
|
||||||
|
Restart=always
|
||||||
|
RestartSec=20s
|
Loading…
Reference in New Issue
Block a user