templates.diff
/var/calculate/remote/templates//builder/squash/dhcpcd/30-hostname 2012-04-20 00:35:22.000000000 +0300 | ||
---|---|---|
1 |
# Calculate format=patch path=/lib/dhcpcd/dhcpcd-hooks |
|
2 |
<reg>\|localhost\|localhost.localdomain</reg> |
|
3 |
<text>|localhost|calculate|calculate.local|localhost.localdomain</text> |
/var/calculate/remote/templates//builder/squash/openrc/rc.conf 2012-05-03 23:51:18.000000000 +0300 | ||
---|---|---|
1 |
# Calculate format=openrc path=/etc |
|
2 |
rc_logger="YES" |
/var/calculate/remote/templates//client/domain/pxe_client/1setup/bin/bashlogin 2012-05-08 10:10:20.000000000 +0300 | ||
---|---|---|
1 |
#!/bin/bash |
|
2 | ||
3 |
LANG=C HOME=/root exec /bin/login |
/var/calculate/remote/templates//client/domain/pxe_client/1setup/etc/shadow 2012-05-10 04:17:32.000000000 +0300 | ||
---|---|---|
1 |
# Calculate format=patch |
|
2 |
<reg>^root:.* |
|
3 |
</reg> |
|
4 |
<text>root:$5$ssssssss$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:ttttt:0::::: |
|
5 |
</text> |
/var/calculate/remote/templates//client/domain/pxe_client/2start/00_restart_syslog.sh 2012-05-08 02:41:22.000000000 +0300 | ||
---|---|---|
1 |
# Calculate exec=/bin/bash path=/tmp |
|
2 | ||
3 |
echo "Starting $0 ..." |
|
4 | ||
5 |
if tail -n1 /var/log/messages | grep -qiE '^\S+\s+\S+\s+[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\s+calculate\s' ; then |
|
6 |
echo "Invalid hostname in /var/log/messages" |
|
7 |
echo "Restarting syslog-ng" |
|
8 |
/etc/init.d/syslog-ng restart |
|
9 |
fi |
|
10 |
: |
/var/calculate/remote/templates//client/domain/pxe_client/2start/10_start_sshd.sh 2012-05-08 02:41:26.000000000 +0300 | ||
---|---|---|
1 |
# Calculate exec=/bin/bash path=/tmp |
|
2 | ||
3 |
echo "Starting $0 ..." |
|
4 | ||
5 |
/etc/init.d/sshd start |
|
6 |
: |
/var/calculate/remote/templates//client/domain/pxe_client/2start/20_remove_guest.sh 2012-05-08 02:41:31.000000000 +0300 | ||
---|---|---|
1 |
# Calculate exec=/bin/bash path=/tmp |
|
2 | ||
3 |
echo "Starting $0 ..." |
|
4 | ||
5 |
/usr/sbin/userdel guest |
|
6 |
: |
/var/calculate/remote/templates//client/domain/pxe_client/2start/30_find_md.sh 2012-05-08 02:41:36.000000000 +0300 | ||
---|---|---|
1 |
# Calculate exec=/bin/bash path=/tmp |
|
2 | ||
3 |
echo "Starting $0 ..." |
|
4 | ||
5 |
MD=`blkid -t TYPE=linux_raid_member` |
|
6 |
if [ -n "${MD}" ]; then |
|
7 |
rc-service -i mdadm start |
|
8 |
fi |
|
9 |
LVM=`blkid -t TYPE=LVM2_member` |
|
10 |
if [ -n "${LVM}" ]; then |
|
11 |
rc-service -i lvm start |
|
12 |
if [ -z "${MD}" ] && blkid -t TYPE=linux_raid_member ; then |
|
13 |
rc-service -i mdadm start |
|
14 |
fi |
|
15 |
fi |
|
16 | ||
17 |
: |
|
18 |
/var/calculate/remote/templates//client/domain/pxe_client/2start/35_find_swap.sh 2012-05-08 02:41:40.000000000 +0300 | ||
---|---|---|
1 |
# Calculate exec=/bin/bash path=/tmp |
|
2 | ||
3 |
echo "Starting $0 ..." |
|
4 | ||
5 |
SWAP=`/sbin/blkid -t TYPE=swap -o device` |
|
6 |
if [ -n "${SWAP}" ]; then |
|
7 |
/sbin/swapon ${SWAP} |
|
8 |
fi |
|
9 | ||
10 |
: |
/var/calculate/remote/templates//client/domain/pxe_client/2start/35_mount_all.sh 2012-05-08 03:37:07.000000000 +0300 | ||
---|---|---|
1 |
# Calculate exec=/bin/bash path=/tmp |
|
2 | ||
3 |
echo "Starting $0 ..." |
|
4 | ||
5 |
FS_MOUNT="ext2,ext3,ext4,reiserfs" |
|
6 | ||
7 |
mkmpoint(){ |
|
8 |
i=0 |
|
9 |
mpoint= |
|
10 |
while ! mkdir "${mpoint}" &>/dev/null; do |
|
11 |
mpoint=/media/`basename ${1}` |
|
12 |
[ "${i}" -gt 0 ] && mpoint="${mpoint}_${i}" |
|
13 |
i=`echo "1+${i}"| bc` |
|
14 |
done |
|
15 |
echo "${mpoint}" |
|
16 |
} |
|
17 | ||
18 |
blkid | sed -nre 's/^(\S+):\s+(LABEL="(\S+)"\s+)?(UUID="(\S+)"\s+)?(TYPE="(\S+)"\s+)?$/\1|\3|\5|\7/p'| \ |
|
19 |
while IFS='|' read dev label uuid type; do |
|
20 |
## echo -e "$dev\t|\t$label\t|\t$uuid\t|\t$type" |
|
21 |
if grep -qw "$type" <<< "${FS_MOUNT}"; then |
|
22 |
grep -qE "^${dev} " /proc/mounts && continue |
|
23 |
mpoint=`mkmpoint ${dev}` |
|
24 |
echo "${dev} ${mpoint} ${type} ro,acl,user_xattr 0 1" >>/etc/fstab |
|
25 |
## mount -voro -t "${type}" "${dev}" "${mpoint}" || rmdir "${mpoint}" |
|
26 |
fi |
|
27 |
done |
|
28 | ||
29 |
/etc/init.d/fsck --nodeps restart |
|
30 |
mount -at "${FS_MOUNT}" |
|
31 |
: |
/var/calculate/remote/templates//client/domain/pxe_client/2start/37_find_root.sh 2012-05-08 03:36:43.000000000 +0300 | ||
---|---|---|
1 |
# Calculate exec=/bin/bash path=/tmp |
|
2 | ||
3 |
echo "Starting $0 ..." |
|
4 | ||
5 |
## Looking for the roots of the system and mount the latest in /mnt/root |
|
6 | ||
7 |
DST=/mnt/root |
|
8 |
[ -d "${DST}" ] && exit 0 |
|
9 | ||
10 |
valid_root(){ |
|
11 |
mpoint="$1" |
|
12 |
grep -qE "^127\.0\.0\.1\s+#-os_net_hostname-#\.#-os_net_domain-#\s+#-os_net_hostname-#\s+localhost" <${mpoint}/etc/hosts && \ |
|
13 |
LANG=C ls -dl "${mpoint}/etc/mtab"| grep -qE -- '^-rw-r--r--\s+\S+\s+root\s+root' && \ |
|
14 |
LANG=C ls -dl "${mpoint}/etc/fstab"| grep -qE -- '^-r...-..-.\s+\S+\s+root\s+root' && \ |
|
15 |
LANG=C ls -dl "${mpoint}/etc/shadow"| grep -qE -- '^-rw-------\s+\S+\s+root\s+root' && \ |
|
16 |
LANG=C ls -dl "${mpoint}/etc/passwd"| grep -qE -- '^-rw-r--r--\s+\S+\s+root\s+root' && \ |
|
17 |
LANG=C ls -dl "${mpoint}/etc/group"| grep -qE -- '^-rw-r--r--\s+\S+\s+root\s+root' && \ |
|
18 |
LANG=C ls -dl "${mpoint}/home/"| grep -qE -- '^drwxr-xr-x\s+\S+\s+root\s+root' && \ |
|
19 |
LANG=C ls -dl "${mpoint}/var/calculate/"| grep -qE -- '^drwxr-xr-x\s+\S+\s+root\s+root' && \ |
|
20 |
return 0 |
|
21 |
return 1 |
|
22 |
} |
|
23 | ||
24 |
root_dir= |
|
25 |
for mpoint in /media/*/; do |
|
26 |
if valid_root "${mpoint}" &>/dev/null ; then |
|
27 |
root_dir="${root_dir} ${mpoint}etc/mtab" |
|
28 |
fi |
|
29 |
done |
|
30 | ||
31 |
if [ -z "${root_dir}" ]; then |
|
32 |
echo "Roots not found" |
|
33 |
exit 0 |
|
34 |
else |
|
35 |
echo "Found:" |
|
36 |
ls -lt ${root_dir} |
|
37 |
fi |
|
38 | ||
39 |
root_dir=`ls -1t ${root_dir} |head -n1` |
|
40 |
root_dir=${root_dir%/etc/mtab} |
|
41 |
mkdir "${DST}" |
|
42 |
mount -v --bind "${root_dir}" "${DST}" |
/var/calculate/remote/templates//client/domain/pxe_client/2start/38_find_calculate.sh 2012-05-08 02:41:57.000000000 +0300 | ||
---|---|---|
1 |
# Calculate exec=/bin/bash path=/tmp |
|
2 | ||
3 |
echo "Starting $0 ..." |
|
4 | ||
5 |
[ -d /mnt/calculate ] && exit 0 |
|
6 |
[ -d /mnt/root ] || exit 0 |
|
7 | ||
8 |
record="`/bin/sed -nre 's:^\s*([0-9A-Za-z/=\-]+\s+)(/var/calculate/?)(\s+[0-9a-z]+\s.*)$:\1:p' </mnt/root/etc/fstab`" |
|
9 | ||
10 |
mkdir -v /mnt/calculate |
|
11 | ||
12 |
if ( dev=`/sbin/blkid $record -o device`|| dev=`/sbin/blkid -t $record -o device`&& /bin/mount "${dev}" -o remount,rw&& /bin/mount ${dev} /mnt/calculate ) then |
|
13 |
mount -v --bind /mnt/calculate/home/ /home/ |
|
14 |
mount -v --bind /mnt/calculate/tmp/ /var/calculate/tmp/ |
|
15 |
else |
|
16 |
rmdir -v /mnt/calculate |
|
17 |
mount -v /mnt/root -o remount,rw |
|
18 |
mount -v /mnt/root/home /home |
|
19 |
fi |
|
20 | ||
21 |
: |
/var/calculate/remote/templates//client/domain/pxe_client/2start/40_correct_ssh_keys.sh 2012-05-08 02:42:04.000000000 +0300 | ||
---|---|---|
1 |
# Calculate exec=/bin/bash path=/tmp |
|
2 | ||
3 |
echo "Starting $0 ..." |
|
4 | ||
5 |
[ -d /mnt/root ] || exit 0 |
|
6 |
cp -a /mnt/root/etc/ssh/ssh_host_*key* /etc/ssh/ && /etc/init.d/sshd restart |
|
7 |
: |
/var/calculate/remote/templates//desktop/screen/.screenrc 2011-04-09 01:51:44.000000000 +0300 | ||
---|---|---|
1 |
# Calculate append=replace cl_name==calculate-desktop exists(~/.screenrc)== path=~/ |
|
2 | ||
3 |
backtick 1 1 1 sh -c 'free -m|awk "/^Mem:/{mt=\$2;mu=\$3;mf=\$4}/^Swap:/{st=\$2;su=\$3;sf=\$4}END{printf(\"Mem:\"mf\"/\"mu);if(su)printf(\"|Swp:\"su\"/\"sf)}"' |
|
4 |
backtick 2 1 1 sh -c 'cat /proc/acpi/battery/*/*|awk "BEGIN{max=0;now=0.;cha=\" \"}/^design capacity:/{max+=\$3}/^remaining capacity:/{now+=100.*\$3}/^charging state: +discharging/{cha=\"-\"}/^charging state: +charging/{cha=\"+\"}END{if(now/max>10){CONVFMT = \"%2.1f\";r=(now/max)\"%\";}else{r=now/100\"/\"max;};printf (\"BAT:%c%s\",cha,r)}" ' |
|
5 |
shelltitle '$|sh' |
|
6 |
shell -$SHELL |
|
7 |
vbell off |
|
8 |
startup_message off |
|
9 |
defscrollback 10000 |
|
10 |
#?ur_group==root# |
|
11 |
caption always "%{+b Wr}$USER@%H%{+b gk} %=[%{r}%h%{g}]%=|%Y-%m-%d%{c}|%c:%s%{w}" |
|
12 |
#ur_group# |
|
13 |
#?ur_group!=root# |
|
14 |
caption always "%{+b wk}$USER@%H%{+b gk} %=[%{r}%h%{g}]%=%{g}|%Y-%m-%d%{c}|%c:%s%{w}" |
|
15 |
#ur_group# |
|
16 |
hardstatus alwayslastline "%{dd}%{+b kg} %w %{dd} %= %{g}|%{dd}%1`%{g}|%{dd}%l%{g}|%{kr}%2`" |
|
17 |
term xterm-256color |
/var/calculate/remote/templates//install/1merge/less/70less 2011-04-02 19:25:42.000000000 +0300 | ||
---|---|---|
1 |
# Calculate format=openrc path=/etc/env.d/ |
|
2 |
LESS="-R -M -i --shift 1" |
|
3 |
LESSCOLOR=always |
/var/calculate/remote/templates//install/1merge/lm_sensors/lm_sensors.init.sh 2012-05-07 18:15:12.000000000 +0300 | ||
---|---|---|
1 |
# Calculate exec=/bin/bash path=/tmp exists(/etc/conf.d/lm_sensors)== |
|
2 | ||
3 |
sh -c '/usr/bin/yes | /usr/sbin/sensors-detect; /usr/bin/touch /etc/conf.d/lm_sensors; /sbin/rc-update add lm_sensors; /etc/init.d/lm_sensors start' &>/dev/null & |
|
4 |
: |
/var/calculate/remote/templates//install/1merge/nano/99editor 2011-04-02 19:24:13.000000000 +0300 | ||
---|---|---|
1 |
# Calculate format=openrc path=/etc/env.d |
|
2 |
EDITOR="/bin/nano" |
|
3 |
VISUAL="/bin/nano" |
/var/calculate/remote/templates//install/1merge/nano/nanorc 2011-04-02 19:26:02.000000000 +0300 | ||
---|---|---|
1 |
# Calculate format=patch path=/etc/ |
|
2 |
<reg>#\s+set\s+(autoindent|const|noconvert|nonewlines|nowrap|regexp|smarthome|smooth|softwrap)</reg> |
|
3 |
<text>set \1</text> |
|
4 |
<reg>#\s+set\s+(tabsize\s+\d+)</reg> |
|
5 |
<text>set tabsize 4</text> |
|
6 |
<reg># include </reg> |
|
7 |
<text>include </text> |
/var/calculate/remote/templates//install/1merge/openrc/rc.conf 2011-04-02 19:24:23.000000000 +0300 | ||
---|---|---|
1 |
# Calculate format=openrc path=/etc |
|
2 |
rc_ulimit="-u 400" |
/var/calculate/remote/templates//install/.calculate_directory 2011-04-11 00:09:43.000000000 +0300 | ||
---|---|---|
1 |
# Calculate append=skip cl_name==calculate-install |