use File::Spec;
use Cwd;
use File::Basename;
+my @FILES_CHECK = (
+ '.nb-install',
+ '.nb-update',
+);
my $FILE_EXISTS = '.nb-install';
my $NB_ROOT = dirname ( dirname ( File::Spec->rel2abs( Cwd::abs_path(__FILE__) ) ) );
grep {$_ ne "" and !$h{$_}++}
map {
- # To reduce glob return, we permit to use file
+ # To reduce glob return, we permit to use file as filter
my $dir = (-e $_ and !-d $_) ? dirname($_) : $_;
- if (-d "$dir/.git") {
- warn "DEBUG: MISSING: $dir/$FILE_EXISTS\n" if $DEBUG and !-r "$dir/$FILE_EXISTS";
- add_args($dir);
- #$dir;
- } else {
+ # Check is git
+ if (!-d "$dir/.git") {
warn "DEBUG: REJECT : $dir\n" if $DEBUG;
"";
- }
+ continue;
+ }
+
+ if ($DEBUG) {
+ for (@FILES_CHECK) {
+ warn "DEBUG: MISSING: $dir/$_\n" if !-r "$dir/$_";
+ }
+ }
+ add_args($dir);
}
glob join(' ',@DIRS)
) ? true : false;
# Look for sqlite db path
-$DIR_SQLITE = '~nicoadm/ownCloud';
+$DIR_SQLITE = '';
foreach ([
'~nico/ownCloud',
'~nicoadm/ownCloud',
$CONF['owncloud'] = [
'host' => "$DIR_SQLITE/owncloud.db",
'type' => 'sqlite',
- 'default_table' => 'oc_users',
+ #'default_table' => 'oc_users',
'default_table' => 'last_files',
'tables' => [
'last_files' => [
+nb_repos_commit_push() {
+ shell_help "Commit each repos whith a comment" "$@" && return
+ local status
+ local pwd=`pwd`
+ for i in $(nb-repo-dirs); do
+ cd "$i" || continue
+
+ printf ">%s\n" "$i"
+ git commit -a -m "$*" && git push | sed 's/^/ /'
+ done
+ cd "$pwd"
+}
+
nb_repos_status() {
shell_help "List repos git status" "$@" && return
local status
-/{opt,opt/www,etc,home,home/www,usr/local/src,home/*/Dev,home/share/git}/*/.nb-install
+/{opt,opt/www,etc,home,home/www,usr/local/src,home/*/Dev,home/share/git}/*/.nb-{install,update}
exit;
}
+ public static function oc_password_verify($pass) {
+ require_once "/home/owncloud/config/config.php";
+ require_once '/opt/owncloud/lib/base.php';
+ require_once '/opt/owncloud/lib/private/Security/Hasher.php';
+ return \OC::$server->getHasher()->hash($pass);
+ $l = new Hasher($CONFIG);
+ debug($l->legacyHashVerify($pass,"YbS9N9cK8TY6b7oyw3skfcHykXIjlx"));
+ return $CONFIG;
+ debug($CONF);
+ }
+
} # < Class
?>