mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
Pakfire an den neuen Server angepasst.
Die Pakete wurden nicht richtig gebaut, da die speiziellen Scripts nicht beruecksichtigt wurden. Fix in der mpfire makefile. syslogdctrl sollte nun die Direktiven besser ersetzen. git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@906 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
@@ -216,9 +216,7 @@
|
||||
* rtorrent-0.7.6
|
||||
* samba-3.0.25c
|
||||
* screen-4.0.2
|
||||
* sdparm-0.90
|
||||
* sdparm-1.01
|
||||
* sdparm-1.02
|
||||
* sed-4.1.5
|
||||
* setserial-2.17
|
||||
* shadow-4.0.15
|
||||
|
||||
@@ -178,7 +178,7 @@ define PAK
|
||||
# Bringing the files to their right place.
|
||||
@rm -rf /install/packages/package
|
||||
@mkdir -p /install/packages/package
|
||||
if [ -e "/usr/src/src/paks $(PROG)" ]; then \
|
||||
if [ -e "/usr/src/src/paks/$(PROG)" ]; then \
|
||||
cp -f /usr/src/src/paks/$(PROG)/{,un}install.sh /usr/src/src/paks/$(PROG)/update.sh \
|
||||
/install/packages/package; \
|
||||
else \
|
||||
|
||||
@@ -65,5 +65,5 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
install -v -m 644 $(DIR_SRC)/config/mpfire/webradio /var/ipfire/mpfire/
|
||||
chown root.nobody /var/ipfire/mpfire/{mpd.conf,playlist.m3u}
|
||||
chown nobody.nobody /var/ipfire/mpfire/{settings,webradio}
|
||||
chown root.nobody /var/ipfire/mpfire/db/mpd.db
|
||||
chown root.nobody /var/ipfire/mpfire/db/mpd.db
|
||||
@$(POSTBUILD)
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
int main(void)
|
||||
{
|
||||
char buffer[STRING_SIZE], hostname[STRING_SIZE], varmessages[STRING_SIZE];
|
||||
char buffer[STRING_SIZE], command[STRING_SIZE], hostname[STRING_SIZE], varmessages[STRING_SIZE];
|
||||
int config_fd,rc,fd,pid;
|
||||
struct stat st;
|
||||
struct keyvalue *kv = NULL;
|
||||
@@ -111,10 +111,8 @@ int main(void)
|
||||
snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/^#\\?\\(\\*\\.\\*[[:blank:]]\\+@\\).\\+$/\\1%s/' /etc/syslog.conf >&%d", hostname, config_fd );
|
||||
else
|
||||
snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/^#\\?\\(\\*\\.\\*[[:blank:]]\\+@.\\+\\)$/#\\1/' /etc/syslog.conf >&%d", config_fd );
|
||||
|
||||
snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's#\\.\\*/var/log/messages\\.\\*#%s /var/log/messages#' /etc/syslog.conf >&%d", varmessages, config_fd );
|
||||
|
||||
/* if the return code isn't 0 failsafe */
|
||||
/* if the return code isn't 0 failsafe */
|
||||
if ((rc = unpriv_system(buffer,99,99)) != 0)
|
||||
{
|
||||
fprintf(stderr, "sed returned bad exit code: %d\n", rc);
|
||||
@@ -123,6 +121,13 @@ int main(void)
|
||||
exit(ERR_CONFIG);
|
||||
}
|
||||
close(config_fd);
|
||||
|
||||
/* Replace the logging option*/
|
||||
|
||||
safe_system("grep -v '/var/log/messages' < /etc/syslog.conf.new > /etc/syslog.conf.tmp && mv /etc/syslog.conf.tmp /etc/syslog.conf.new");
|
||||
snprintf(command, STRING_SIZE-1, "printf '%s /var/log/messages' >> /etc/syslog.conf.new", varmessages );
|
||||
safe_system(command);
|
||||
|
||||
if (rename("/etc/syslog.conf.new", "/etc/syslog.conf") == -1)
|
||||
{
|
||||
perror("Unable to replace old config file");
|
||||
|
||||
@@ -166,10 +166,10 @@ sub fetchfile {
|
||||
&General::readhash("${General::swroot}/proxy/advanced/settings", \%proxysettings);
|
||||
|
||||
if ($proxysettings{'UPSTREAM_PROXY'}) {
|
||||
logger("DOWNLOAD INFO: Upstream proxy: \"$proxysettings{'UPSTREAM_PROXY'}\"") unless ($bfile =~ /^counter\?.*/);
|
||||
logger("DOWNLOAD INFO: Upstream proxy: \"$proxysettings{'UPSTREAM_PROXY'}\"") unless ($bfile =~ /^counter.py\?.*/);
|
||||
if ($proxysettings{'UPSTREAM_USER'}) {
|
||||
$ua->proxy("http","http://$proxysettings{'UPSTREAM_USER'}:$proxysettings{'UPSTREAM_PASSWORD'}@"."$proxysettings{'UPSTREAM_PROXY'}/");
|
||||
logger("DOWNLOAD INFO: Logging in with: \"$proxysettings{'UPSTREAM_USER'}\" - \"$proxysettings{'UPSTREAM_PASSWORD'}\"") unless ($bfile =~ /^counter\?.*/);
|
||||
logger("DOWNLOAD INFO: Logging in with: \"$proxysettings{'UPSTREAM_USER'}\" - \"$proxysettings{'UPSTREAM_PASSWORD'}\"") unless ($bfile =~ /^counter.py\?.*/);
|
||||
} else {
|
||||
$ua->proxy("http","http://$proxysettings{'UPSTREAM_PROXY'}/");
|
||||
}
|
||||
@@ -179,7 +179,7 @@ sub fetchfile {
|
||||
my $url = "http://$host/$file";
|
||||
my $response;
|
||||
|
||||
unless ($bfile =~ /^counter\?.*/) {
|
||||
unless ($bfile =~ /^counter.py\?.*/) {
|
||||
my $result = $ua->head($url);
|
||||
my $remote_headers = $result->headers;
|
||||
$total_size = $remote_headers->content_length;
|
||||
@@ -201,7 +201,7 @@ sub fetchfile {
|
||||
}
|
||||
|
||||
if ($response->is_success) {
|
||||
unless ($bfile =~ /^counter\?.*/) {
|
||||
unless ($bfile =~ /^counter.py\?.*/) {
|
||||
if (open(FILE, ">$Conf::tmpdir/$bfile")) {
|
||||
print FILE $final_data;
|
||||
close(FILE);
|
||||
@@ -644,7 +644,7 @@ sub setuppak {
|
||||
my $return = system("cd $Conf::tmpdir && NAME=$pak ./install.sh >> $Conf::logdir/install-$pak.log 2>&1");
|
||||
$return %= 255;
|
||||
if ($pakfiresettings{'UUID'} ne "off") {
|
||||
fetchfile("cgi-bin/counter?ver=$Conf::version&uuid=$Conf::uuid&ipak=$pak&return=$return", "$Conf::mainserver");
|
||||
fetchfile("counter.py?ver=$Conf::version&uuid=$Conf::uuid&ipak=$pak&return=$return", "$Conf::mainserver");
|
||||
}
|
||||
if ($return == 0) {
|
||||
move("$Conf::tmpdir/ROOTFILES", "$Conf::dbdir/rootfiles/$pak");
|
||||
@@ -705,7 +705,7 @@ sub upgradepak {
|
||||
my $return = system("cd $Conf::tmpdir && NAME=$pak ./update.sh >> $Conf::logdir/update-$pak.log 2>&1");
|
||||
$return %= 255;
|
||||
if ($pakfiresettings{'UUID'} ne "off") {
|
||||
fetchfile("cgi-bin/counter?ver=$Conf::version&uuid=$Conf::uuid&upak=$pak&return=$return", "$Conf::mainserver");
|
||||
fetchfile("counter.py?ver=$Conf::version&uuid=$Conf::uuid&upak=$pak&return=$return", "$Conf::mainserver");
|
||||
}
|
||||
if ($return == 0) {
|
||||
move("$Conf::tmpdir/ROOTFILES", "$Conf::dbdir/rootfiles/$pak");
|
||||
@@ -730,7 +730,7 @@ sub removepak {
|
||||
my $return = system("cd $Conf::tmpdir && NAME=$pak ./uninstall.sh >> $Conf::logdir/uninstall-$pak.log 2>&1");
|
||||
$return %= 255;
|
||||
if ($pakfiresettings{'UUID'} ne "off") {
|
||||
fetchfile("cgi-bin/counter?ver=$Conf::version&uuid=$Conf::uuid&dpak=$pak&return=$return", "$Conf::mainserver");
|
||||
fetchfile("counter.py?ver=$Conf::version&uuid=$Conf::uuid&dpak=$pak&return=$return", "$Conf::mainserver");
|
||||
}
|
||||
if ($return == 0) {
|
||||
open(FILE, "<$Conf::dbdir/rootfiles/$pak");
|
||||
@@ -793,7 +793,7 @@ sub senduuid {
|
||||
$Conf::uuid = `cat $Conf::dbdir/uuid`;
|
||||
}
|
||||
logger("Sending my uuid: $Conf::uuid");
|
||||
fetchfile("cgi-bin/counter?ver=$Conf::version&uuid=$Conf::uuid", "$Conf::mainserver");
|
||||
fetchfile("counter.py?ver=$Conf::version&uuid=$Conf::uuid", "$Conf::mainserver");
|
||||
system("rm -f $Conf::tmpdir/counter* 2>/dev/null");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,20 +25,15 @@ extract_files() {
|
||||
echo "...Finished."
|
||||
}
|
||||
|
||||
reload_all() {
|
||||
reload_modules
|
||||
reload_libs
|
||||
}
|
||||
|
||||
reload_libs() {
|
||||
echo "(Re-)Initializing the lib-cache..."
|
||||
ldconfig
|
||||
ldconfig -vv
|
||||
echo "...Finished."
|
||||
}
|
||||
|
||||
reload_modules() {
|
||||
echo "(Re-)Initializing the module-dependencies..."
|
||||
depmod -a
|
||||
depmod -va
|
||||
echo "...Finished."
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
|
||||
extract_files
|
||||
|
||||
chown clamav:clamav /usr/share/clamav
|
||||
chown clamav:clamav /usr/share/clamav -Rv
|
||||
|
||||
/usr/local/bin/clamavctrl enable
|
||||
|
||||
@@ -2,5 +2,3 @@
|
||||
. /opt/pakfire/lib/functions.sh
|
||||
|
||||
extract_files
|
||||
|
||||
reload_all
|
||||
|
||||
@@ -2,5 +2,3 @@
|
||||
. /opt/pakfire/lib/functions.sh
|
||||
|
||||
extract_files
|
||||
|
||||
reload_all
|
||||
|
||||
Reference in New Issue
Block a user