Kamis, 07 Januari 2010

seting repositori osol 2009.06 (iso) di osol 2009.6

kopi berkas osol-repo-0906-full.iso ke direktori /

kopikan script bash berikut menjadi file /tmp/setup.sh
kemudian chmod +x /tmp/setup.sh
#/tmp/setup.sh

#!/bin/bash
lofiadm -a /osol-repo-0906-full.iso;
mkdir /repo;
mount -F hsfs /dev/lofi/1 /repo/;
cd /repo/;
svccfg -s application/pkg/server setprop pkg/inst_root=/repo/repo;
svccfg -s application/pkg/server setprop pkg/readonly=true;
svccfg -s application/pkg/server setprop pkg/port=10000;
cp /repo/repo/cfg_cache /etc/0906_cfg_cache;
sed -e 's/pkg.opensolaris.org\/release/localhost:10000\//g' /etc/0906_cfg_cache > /tmp/0906_cfg_cache;
mv /tmp/0906_cfg_cache /etc/0906_cfg_cache;
svccfg -s application/pkg/server setprop pkg/cfg_file=/etc/0906_cfg_cache;
svcadm refresh application/pkg/server;
svcadm enable application/pkg/server;
sleep 10;
hasil=`netstat -na|grep *.10000`;
if [ -n "$hasil" ];then
echo
echo "seting publisher ke localhost:10000";
pkg set-publisher -O http://localhost:10000/ opensolaris.org;
echo
pkg image-update
echo "telah berhasil menset"
else
echo
echo "port tidak terbuka";
echo
echo "berikut laporan dari lognya";
tail -n 10 /var/svc/log/application-pkg-server\:default.log
echo
fi

Tidak ada komentar:

Posting Komentar