Script to create module folder

master
Eirik Th S 2021-09-07 09:53:27 +02:00
parent 36016c1a75
commit 536cf0e4e9
1 changed files with 24 additions and 0 deletions

24
createModuleFolder.sh Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/bash
modulnr=$1
#echo $modulnr
if [ "$#" -ne 1 ]; then
echo "Usage: $0 NUMBER" >&2
exit 1
fi
if ! [ -d "modul$modulnr" ]; then
mkdir modul$modulnr
cd modul$modulnr
cp -s ../modul1/index.css ./
cp -s ../modul1/index.php ./
cp -s ../modul1/common.php ./
cp ../mal.php "./index$(echo $modulnr)_1.php"
echo "OK"
else
echo "Module already created"
fi