File: perms.sh

package info (click to toggle)
open-plc-utils 0.0.6%2Bgit20230504.1ba7d5a0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 17,212 kB
  • sloc: ansic: 60,875; xml: 16,179; sh: 1,216; makefile: 698
file content (33 lines) | stat: -rwxr-xr-x 672 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# file: recurse.sh

# ====================================================================
#
# --------------------------------------------------------------------

HOST=${HOSTNAME}
MODE=6775
OWNER=${USER}
GROUP=plc

# ====================================================================
#
# --------------------------------------------------------------------

if [ ${HOSTNAME} != ${HOST} ]; then
	echo "This host is not ${HOST}."
	exit 1
	fi
if [ -z ${1} ]; then
	echo "Specify full path to folder."
	exit 1
	fi
for file in ${1}/*; do
	chown ${OWNER}:${GROUP} ${file}
	if [ -d ${file} ]; then
		echo ${file}
		chmod ${MODE} ${file}
		${0} ${file}
		fi
done