Merge /home/users/nico/cLinux/scripts/install-scripts

This commit is contained in:
Nico Schottelius 2009-12-29 18:28:03 +01:00
commit 4b053c5e5b
10 changed files with 136 additions and 0 deletions

7
crypt-dev.rand.key Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
# cLinux
# Nico Schottelius (nico-linux@schottelius.org)
# 2004-12
#
dd if=/dev/urandom bs=512 count=2 | cryptsetup create swap "$1"
#dd if=/dev/urandom bs=512 count=2 | cryptsetup create swap /dev/hda6

10
install-packages Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
# cLinux
# Nico Schottelius (nico-linux@schottelius.org)
# 2004-12
#
PACKAGES=$@
ALL_PACKAGES=`

40
link-subdir Executable file
View file

@ -0,0 +1,40 @@
#!/bin/sh
#
# Nico Schottelius <nico-linux //@// schottelius.org>
# Date: 13-Mär-2007
# Last Modified: -
# Description: Links files from /usr/packages/$pkg/$dir/* to /usr/local/$dir
#
if [ "$#" -ne 2 ]; then
echo "$0: package (below /usr/packages/) subdir (like bin, lib or include)"
exit 1
fi
basedir="$1"
subdir="$2"
destination=/usr/local
ddir="${destination}/${subdir}"
# test for existence, abort if conflicts are there
do_exit=0
for file in "${basedir}/${subdir}"/*; do
basename=$(basename "$file")
dest="${ddir}/${basename}"
if [ -e "${dest}" ]; then
echo "${dest} already exists, abort"
do_exit=1
fi
done
if [ "$do_exit" = 1 ]; then
exit 1
fi
# link!
for file in "${basedir}/${subdir}"/*; do
ln -s "$file" "$ddir"
done

29
link-subdir-hard Executable file
View file

@ -0,0 +1,29 @@
#!/bin/sh
#
# Nico Schottelius <nico-linux //@// schottelius.org>
# Date: 13-Mär-2007
# Last Modified: -
# Description: Links files from /usr/packages/$pkg/$dir/* to /usr/local/$dir
#
if [ "$#" -ne 2 ]; then
echo "$0: package (below /usr/packages/) subdir (like bin, lib or include)"
exit 1
fi
basedir="$1"
subdir="$2"
destination=/usr/local
ddir="${destination}/${subdir}"
# link!
for file in "${basedir}/${subdir}"/*; do
if [ -f "$file" ]; then
ln "$file" "$ddir"
else
# directory
ln -s "$file" "$ddir"
fi
done

11
mkcrypt.swap Executable file
View file

@ -0,0 +1,11 @@
#!/bin/sh
# cLinux
# Nico Schottelius (nico-linux@schottelius.org)
# 2004-12-29
# create swap devices from $argv
i=0
for i in devices ...
crypt-dev.rand.key "$1"
###dd if=/dev/urandom bs=512 count=2 | cryptsetup create swap "$1"
####dd if=/dev/urandom bs=512 count=2 | cryptsetup create swap /dev/hda6

9
permissions.group-work Executable file
View file

@ -0,0 +1,9 @@
#!/bin/sh
#
# Nico Schottelius <nico-linux@schottelius.org>
# Date: 09-Nov-2005
# Last Modified: -
#
find "$1" -type d -exec chmod 0770 {} \;
find "$1" -type f -exec chmod u+rw,g+rw,o-rwx {} \;

8
permissions.private Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
#
# Nico Schottelius <nico-linux@schottelius.org>
# Date: 09-Nov-2005
# Last Modified: -
#
find "$1" -exec chmod og-rwx {} \;

9
permissions.public Executable file
View file

@ -0,0 +1,9 @@
#!/bin/sh
#
# Nico Schottelius <nico-linux@schottelius.org>
# Date: 09-Nov-2005
# Last Modified: -
#
find "$1" -type d -exec chmod 0755 {} \;
find "$1" -type f -exec chmod a+r {} \;

7
reread-partition Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
# cLinux
# Nico Schottelius (nico-linux@schottelius.org)
# 2004-12
#
hdparm -z $1

6
tune-ide-hd Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh
# Nico Schottelius (nico-linux@schottelius.org)
# 2004-12
#
hdparm -d1 -c1 $1