[ Index ] |
PHP Cross Reference of Unnamed Project |
[Summary view] [Print] [Text view]
1 #!/bin/bash 2 ## $Id: permbackuppc 8417 2015-01-27 23:57:17Z keyser $ ## 3 # 4 ##### Permet de positionner les droits pour backuppc ##### 5 # 6 7 if [ "$1" = "--help" -o "$1" = "-h" ] 8 then 9 echo "Script permettant de positionner les droits pour backuppc." 10 11 echo "Usage : pas d'option" 12 exit 13 fi 14 [ "$1" = "--full" -o "$1" = "-f" ] && option="-R" 15 bck_user="backuppc" 16 17 if [ -e /var/run/backuppc/BackupPC.pid ]; then 18 invoke-rc.d backuppc stop 19 bpc_etat="1" 20 fi 21 22 #sed "s/www-se3/backuppc/" -i /etc/init.d/backuppc 23 #[ -e /etc/backuppc/config.pl ] && sed "s/www-se3/backuppc/g" -i /etc/backuppc/config.pl 24 25 26 chown -R www-se3.backuppc /usr/share/backuppc 27 chown -R $bck_user.www-data /etc/backuppc 28 chmod -R 770 /etc/backuppc 29 chown $bck_user.www-data /etc/SeConfig.ph 30 chmod 640 /etc/SeConfig.ph 31 chown $bck_user /usr/share/backuppc/cgi-bin/index.cgi 32 chmod u+s /usr/share/backuppc/cgi-bin/index.cgi 33 chown -R $bck_user /var/run/backuppc 34 if [ -h /var/lib/backuppc ]; then 35 repsauve=$(readlink /var/lib/backuppc) 36 else 37 repsauve="/var/lib/backuppc" 38 fi 39 40 [ "$(stat $repsauve -c %U)" != "$bck_user" ] && chown $option $bck_user $repsauve 41 42 43 # getfacl $repsauve 2>/dev/null|grep owner|grep $bck_user||chown $option $bck_user $repsauve 44 if [ "$option" != "-R" ]; then 45 chown backuppc:backuppc /var/lib/backuppc/pc 46 chown backuppc:backuppc /var/lib/backuppc/cpool 47 chown -R backuppc:backuppc /var/lib/backuppc/log 48 fi 49 50 if [ "$bpc_etat" == "1" ]; then 51 invoke-rc.d backuppc start 52 fi 53 exit 0
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Tue Mar 17 22:47:18 2015 | Cross-referenced by PHPXref 0.7.1 |