Initial commit

This commit is contained in:
2022-02-20 12:07:59 +01:00
commit 42c3774ca6
114 changed files with 27589 additions and 0 deletions

View File

@ -0,0 +1,44 @@
# {{ ansible_managed }}
# ------------------------------------
# - Settings for script clean_trash.sh
# ------------------------------------
# - days
# -
# - Files older then 'days' will be deleted.
# -
# - Defaults to: days=31
# -
#days=31
# - trash_dirs
# -
# - Directories where files older than given days will be deleted.
# -
# - Example:
# - trash_dirs="/data/samba/transfer/.Trash /data/samba/no-backup-share/multimedia/.Trash"
# -
#trash_dirs=""
{%- set count = namespace(trash_dirs=0) %}
{%- for item in samba_shares | default([]) %}
{% if (item.vfs_object_recycle is defined and item.vfs_object_recycle|bool) %}
{% if item.recycle_path is defined and item.recycle_path|length > 0 %}
{% set count.trash_dirs = count.trash_dirs + 1 %}
{% endif %}
{% endif %}
{% endfor %}
{% if count.trash_dirs > 0 %}
trash_dirs="
{% for item in samba_shares %}
{% if (item.vfs_object_recycle is defined and item.vfs_object_recycle|bool) %}
{% if item.recycle_path is defined and item.recycle_path|length > 0 %}
{{ item.path }}/{{ item.recycle_path }}
{% endif %}
{% endif %}
{% endfor %}
"
{% endif %}

View File

@ -0,0 +1,37 @@
# {{ ansible_managed }}
# -----------------------------------------------------
# - Settings for script set_permissions_samba_shares.sh
# -----------------------------------------------------
# - dir_permissions
# -
# - Recursive set Permissions (group and file- and directory-mode)
# -
# - Multiple options are possible. Use semicolon separated list.
# -
# - Usage:
# - dir_permissions="<directory>:<group>:<file-mod>:<dir-mod>;[<directory>:<group>:<file-mod>:<dir-mod>];[.."
# -
# - Example:
# - dir_permissions="/data/samba/transfer:buero:664:2775;/data/samba/verwaltung:intern:660:2770"
# -
#dir_permissions=""
{%- set count = namespace(samba_shares=0) %}
{%- for item in samba_shares | default([]) %}
{% set count.samba_shares = count.samba_shares + 1 %}
{% endfor %}
{% if count.samba_shares > 0 %}
dir_permissions="
{% for item in samba_shares | default([]) %}
{% if item.file_create_mask is defined and item.file_create_mask|length > 0
and item.dir_create_mask is defined and item.dir_create_mask|length > 0
and item.group_write_list is defined and item.group_write_list|length > 0 %}
{{ item.path }}:{{ item.group_write_list | default('root', true) }}:{{ item.file_create_mask|string | default('660', true) }}:{{ item.dir_create_mask | default('2770', true) }};
{% endif %}
{% endfor %}
"
{% endif %}

View File

@ -0,0 +1,78 @@
#!/usr/bin/env bash
# {{ ansible_managed }}
declare -i pc_nr=101
pc_nr_max=135
brcast_ip="192.168.112.255"
pc101="80:ee:73:ea:3a:9d 80:ee:73:ea:3a:9e"
pc102="80:ee:73:ea:3a:e7 80:ee:73:ea:3a:e8"
pc103="80:ee:73:ea:3a:0b 80:ee:73:ea:3a:0c"
pc104="80:ee:73:ea:3b:73 80:ee:73:ea:3b:74"
pc105="80:ee:73:c5:e7:4f 80:ee:73:c5:e7:50"
pc106="20:25:64:0c:55:ca"
pc107="10:e7:c6:37:f7:35"
pc108="74:d4:35:8d:0d:8c"
pc109="80:ee:73:e2:20:8b 80:ee:73:e2:20:8c"
pc110="80:ee:73:c5:e6:5f 80:ee:73:c5:e6:60"
pc111="80:ee:73:b5:e4:50 80:ee:73:b5:e4:51"
pc112="f8:b4:6a:be:48:75"
pc113="20:25:64:0c:55:6b"
pc114="00:22:4d:88:4b:d0"
pc115="00:22:4d:88:4b:be"
pc116="80:ee:73:c9:91:d7 80:ee:73:c9:91:d8"
pc117="74:d4:35:be:a4:5a"
pc118="b0:0c:d1:54:ed:12"
pc121="80:ee:73:bd:ad:56 80:ee:73:bd:ad:57"
pc123="00:22:4d:88:4b:33"
pc124="80:ee:73:c0:7f:fb 80:ee:73:c0:7f:fc"
pc125="80:ee:73:b9:8e:9b 80:ee:73:b9:8e:9c"
pc126="80:ee:73:c5:e8:39 80:ee:73:c5:e8:3a"
pc127="a8:a1:59:0c:d5:eb"
pc128="a8:a1:59:0d:01:b9"
#pc129="a8:a1:59:0a:28:22"
pc129="a8:a1:59:06:12:b8"
pc135="1c:69:7a:a3:e1:b3"
#pc119="00:22:4d:88:4b:b2"
pc120="00:22:4d:88:48:c7"
pc122="00:22:4d:88:4b:dc"
#pc127="08:9e:01:35:10:55"
#pc128="80:ee:73:b5:e2:95"
pc131="80:ee:73:d9:de:32"
if [ $# = "1" ]; then
echo ""
echo -e " \033[32mWake up PC '$1'\033[m.."
_nic=`eval eval echo '$'$1`
if [[ -n "$_nic" ]]; then
for _mac in $_nic ; do
echo -n " "
wakeonlan -i $brcast_ip $_mac
sleep 1
done
else
echo -e " \033[1;31mPC '$1' NOT found!\033[m"
fi
echo ""
else
while [[ $pc_nr -le $pc_nr_max ]]; do
[[ -z "$pc_nr" ]] && continue
_nic=$(eval eval echo '$pc'$pc_nr)
if [[ -n "$_nic" ]]; then
echo ""
echo -e " \033[32mWake up PC 'pc$pc_nr'\033[m.."
for _mac in $_nic ; do
echo -n " "
/usr/bin/wakeonlan -i $brcast_ip $_mac
sleep 1
done
fi
(( pc_nr++ ))
done
echo ""
fi