- ;;
-newpak)
- # create structure for a new package
- echo -e "Name of the new package: $2"
- if [ ! -f "lfs/$2" ]; then
- echo "`date -u '+%b %e %T'`: Creating directory src/paks/$2"
- mkdir -p src/paks/$2
- cd src/paks/$2
- echo "`date -u '+%b %e %T'`: Creating files"
- cp $BASEDIR/lfs/postfix $BASEDIR/lfs/$2
-
- touch ROOTFILES
- touch {,un}install.sh
- ## install.sh
- echo '#!/bin/bash' > install.sh
- echo '#' >> install.sh
- echo '#################################################################' >> install.sh
- echo '# #' >> install.sh
- echo '# This file belongs to IPFire Firewall - GPLv2 - www.ipfire.org #' >> install.sh
- echo '# #' >> install.sh
- echo '#################################################################' >> install.sh
- echo '#' >> install.sh
- echo '# Extract the files' >> install.sh
- echo 'tar xfz files.tgz -C /' >> install.sh
- echo 'cp -f ROOTFILES /opt/pakfire/installed/ROOTFILES.$2' >> install.sh
- ## uninstall.sh
- echo '#!/bin/bash' > uninstall.sh
- echo '#################################################################' >> uninstall.sh
- echo '# #' >> uninstall.sh
- echo '# This file belongs to IPFire Firewall - GPLv2 - www.ipfire.org #' >> uninstall.sh
- echo '# #' >> uninstall.sh
- echo '#################################################################' >> uninstall.sh
- echo '#' >> uninstall.sh
- echo '# Delete the files' >> uninstall.sh
- echo '## Befehl fehlt noch' >> uninstall.sh
- echo 'rm -f /opt/pakfire/installed/ROOTFILES.$2' >> uninstall.sh
- echo "`date -u '+%b %e %T'`: Adding files to SVN"
- cd - && svn add lfs/$2 && svn add src/paks/$2
-
- echo -n "Do you want to remove the folders? [y/n]"
- read REM
- if [ "$REM" == "y" ]; then
- echo "Removing the folders..."
- svn del src/paks/$2 --force
- else
- echo "Folders are kept."
- fi
- else
- echo "$2 already exists"
- fi
- exit 0