commit - 6941c9c13d739183241826b5c924ef1608b73c3e
commit + a3c221cdf90cf90692839a964d8d065c2254c751
blob - c725f59d1bba9b37ce95de1a763f46af50265a38
blob + 90c8df62e7d17bedbb2e2eaf869f927fcb31d163
--- botnow
+++ botnow
sub writefile {
my ($filename, $str) = @_;
my $date = date();
- copy($filename, $homepath.basename($filename).".".date()) or die "Could not make backup of $filename";
+ copy($filename, $backuppath.basename($filename).".".date()) or die "Could not make backup of $filename";
open(my $fh, '>', "$filename") or die "Could not write to $filename";
print $fh $str;
close $fh;
# Path to configuration file
my $confpath = "botnow.conf";
-my $homepath = "/home/botnow";
+my $backuppath = "/home/botnow/backups/";
# Configuration variables will be stored in key => value pairs
our %conf;
unveil("./", "r") or die "Unable to unveil $!";
unveil("$confpath", "r") or die "Unable to unveil $!";
-unveil("$homepath", "rwc") or die "Unable to unveil $!";
+unveil("$backuppath", "rwc") or die "Unable to unveil $!";
unveil() or die "Unable to lock unveil $!";
#dns and inet for sockets, proc and exec for figlet
blob - 253da02ca13c10b3ae15829bb3a5a04db76cee3d
blob + d352434e5240ad4a272a3870ffcd2baf842754d5
--- install
+++ install
useradd -m -g =uid -c ${USERNAME} -d ${HOMEDIR} -s /bin/ksh ${USERNAME}
fi
mkdir ${HOMEDIR}
-chmod go-rx ${HOMEDIR}
mkdir ${DATABASE}
chmod o-rx ${DATABASE}
touch ${DATABASE}/www
usermod -G _dovecot botnow
chmod g+rw ${HOSTNAMEIF}
cp captcha.png register.php ${HTDOCS}/
-cp LICENSE README botnow botnow.conf.example BNC.pm DNS.pm Mail.pm SQLite.pm Shell.pm table.sql Hash.pm Help.pm install networks captcha.png register.php words ${HOMEDIR}/
+cp LICENSE README botnow botnow.conf.example BNC.pm DNS.pm Mail.pm SQLite.pm Shell.pm table.sql Hash.pm Help.pm install networks captcha.png register.php words backups ${HOMEDIR}/
chown -R ${USERNAME}:${USERNAME} ${HOMEDIR}
+chmod -R go-rx ${HOMEDIR}
chmod u+x ${HOMEDIR}/botnow
chown -R ${ZNCUSER}:daemon ${ZNCDIR}
chmod -R ug+r ${ZNCDIR}