forked from extern/zfs-auto-snapshot
Filesystems weren't exluded - spaces are not tabs.
auto_include shouldn't parse column headers. Postinstall script should work on SXCE too.
This commit is contained in:
parent
77eda5fb7b
commit
b62130a877
@ -879,8 +879,8 @@ function auto_include {
|
||||
POOLS=$(zpool list -H -o name)
|
||||
for pool in $POOLS ; do
|
||||
if ! zpool status -x $pool | grep "state: UNAVAIL" > /dev/null ; then
|
||||
SNAPALL=$(zfs get com.sun:auto-snapshot $pool)
|
||||
SNAPLABEL=$(zfs get com.sun:auto-snapshot:$LABEL $pool)
|
||||
SNAPALL=$(zfs get -H -o value com.sun:auto-snapshot $pool)
|
||||
SNAPLABEL=$(zfs get -H -o value com.sun:auto-snapshot:$LABEL $pool)
|
||||
SNAP=$SNAPALL$SNAPLABEL
|
||||
case $SNAP in
|
||||
*true | true*)
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/ksh
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# CDDL HEADER START
|
||||
@ -32,7 +32,7 @@
|
||||
# Check if the first argument is 0, settting our return
|
||||
# variable to an error otherwise
|
||||
#
|
||||
function check_error {
|
||||
check_error() {
|
||||
RETURN_CODE=$1
|
||||
ERROR="$2"
|
||||
if [ "$RETURN_CODE" -ne 0 ] ; then
|
||||
@ -40,32 +40,28 @@ function check_error {
|
||||
fi
|
||||
}
|
||||
|
||||
function user_exists {
|
||||
typeset USER=$1
|
||||
if /usr/bin/grep ^$USER: $BASEDIR/etc/passwd > /dev/null ; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
user_exists() {
|
||||
USER=$1
|
||||
/usr/bin/grep "^$USER:" $BASEDIR/etc/passwd > /dev/null
|
||||
return $?
|
||||
}
|
||||
|
||||
function auth_exists {
|
||||
typeset AUTH=$1
|
||||
if /usr/bin/grep ^$AUTH: $BASEDIR/etc/security/auth_attr > /dev/null ; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
auth_exists() {
|
||||
AUTH=$1
|
||||
/usr/bin/grep "^$AUTH:" $BASEDIR/etc/security/auth_attr > /dev/null
|
||||
return $?
|
||||
}
|
||||
|
||||
# add our authorization
|
||||
if ! auth_exists solaris.smf.manage.zfs-auto-snapshot; then
|
||||
auth_exists solaris.smf.manage.zfs-auto-snapshot
|
||||
if [ $? -ne 0 ] ; then
|
||||
echo "solaris.smf.manage.zfs-auto-snapshot:::Manage the ZFS Automatic Snapshot Service::" \
|
||||
>> /etc/security/auth_attr
|
||||
fi
|
||||
|
||||
# add the zfssnap role - probably only works on a local system :-(
|
||||
if ! user_exists zfssnap; then
|
||||
user_exists zfssnap
|
||||
if [ $? -ne 0 ] ; then
|
||||
/usr/sbin/roleadd -d /export/home/zfssnap -c "ZFS Automatic Snapshots role" \
|
||||
-P "ZFS File System Management" \
|
||||
-A solaris.smf.manage.zfs-auto-snapshot -m zfssnap
|
||||
|
Loading…
Reference in New Issue
Block a user