Skripte

Diese Skripte sind teilweise schon über eine Dekade alt, nützlich sind sie aber trotzdem noch gelegentlich. Für mich zumindest.

skeleton.sh

Download: skeleton.sh

#!/bin/bash
#
# Simple script-skeleton by https://noinfo.de
#

if [ "$1" = "" ];
then
echo "Usage: $0 [on|off]"
exit 1
fi

if [ $1 = 'on' ];
then
echo "on!"
exit 0
fi

if [ $1 = 'off' ];
then
echo "off"
exit 0
fi

echo "Usage: $0 [on|off]"
exit 1

backup.sh

Download: backup.sh

#!/bin/bash
# Another useless script by https://noinfo.de
#
# Just change BACKUP_ROOT to the root of your backup-dir
# and BACKUP_THIS to the root of your important files and
# your data will be copied (recursively!) to a directory
# which will be created inside the BACKUP_ROOT and named
# after the current timestamp.
#
# If you have trouble using it, try
# curl -O https://noinfo.de/skripte/backup.sh
# to download the script
#
TIMESTAMP=`date +%Y_%j-%H_%M_%S`
BACKUP_ROOT=~/backup_root
BACKUP_THIS=/important_files_here
cp -R $BACKUP_THIS $BACKUP_ROOT/$TIMESTAMP/
exit 0

schleife.sh

Download: schleife.sh

#!/bin/sh
# Another useless script by https://noinfo.de
#
echo "Welcher Befehl soll geloopt werden?"
read LOOPCOMMAND
while : ; do $LOOPCOMMAND ; \
echo "+++++++++++++++" ; sleep 10 ; done