Commit fff60e6b authored by claes's avatar claes

OpenBSD package work

parent 7bad33d8
# port/package comment, name, category, and maintainer.
COMMENT= Proview development and runtime package
DISTNAME= pwr48-4.8.3
CATEGORIES= misc
MAINTAINER= Proview <postmaster@proview.se>
# Mandatory licensing variables.
PERMIT_PACKAGE_CDROM= NO
PERMIT_PACKAGE_FTP= NO
PERMIT_DISTFILES_CDROM= NO
PERMIT_DISTFILES_FTP= NO
# Don't build or run regress tests; specify all architectures.
NO_BUILD= Yes
NO_REGRESS= Yes
PKG_ARCH= amd64
# Install under /usr/local/.
do-install:
${INSTALL_SCRIPT} ${WRKSRC}/bin/* ${PREFIX}/bin/
${INSTALL_DATA_DIR} ${PREFIX}/share/myscripts/
${INSTALL_DATA} ${WRKSRC}/share/pwr48/* ${PREFIX}/share/pwr48/
# Include the BSD port system.
.include <bsd.port.mk>
#!/bin/bash
set -o xtrace
aroot="/usr/pwrp/adm"
pkgsrc=$pwre_sroot/tools/pkg/openbsd/pwr
# Get version
if [ -e $pwr_inc/pwr_version.h ]; then
ver=`eval cat $pwr_inc/pwr_version.h | grep "[[:<:]]pwrv_cWbdbVersionShortStr[[:>:]]" | awk '{print $3}'`
if [ -z $ver ]; then
echo "Unable to get pwr version"
ver="V00"
fi
ver=${ver:2:2}
fi
# Generate version help file
{
if [ ! -e $pkgsrc/control ]; then
echo "Controlfile not found"
exit 1
fi
datfile=$pkgsrc/control
echo "<topic> version"
d=`eval date +\"%F %X\"`
{
let printout=0
while read line; do
if [ "${line:0:9}" = "Package: " ]; then
package=${line#Package: }
fi
if [ "${line:0:9}" = "Version: " ]; then
version=${line#Version: }
fi
if [ "${line:0:14}" = "Architecture: " ]; then
arch=${line#Architecture: }
fi
if [ "${line:0:12}" = "Description:" ]; then
echo ""
echo "<image> pwr_logga.gif"
echo ""
echo ""
echo ""
echo "<b>Proview V${version:0:3}"
echo "Version V$version"
echo ""
echo "Copyright 2004-${d:0:4} SSAB Oxelsund AB"
echo ""
echo "This program is free software; you can redistribute it and/or"
echo "modify it under the terms of the GNU General Public License as"
echo "published by the Free Software Foundation, either version 2 of"
echo "the License, or (at your option) any later version."
echo ""
echo "This program is distributed in the hope that it will be useful"
echo "but WITHOUT ANY WARRANTY; without even the implied warranty of"
echo "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
echo "For more details, see the"
echo "GNU General Public License. <weblink> http://www.proview.se/gpllicense.html"
echo ""
echo "E-mail postmaster@proview.se"
echo "Internet www.proview.se <link> http://www.proview.se/index.html"
echo ""
echo ""
echo "<b>Package"
echo "Package $package""_""$version""_""$arch"
echo "Build date $d"
echo "Package description:"
echo ""
printout=1
else
if [ $printout -eq 1 ]; then
echo $line
fi
fi
done
} < $datfile
echo "</topic>"
} > $pwr_eexe/wtt_version_help.dat
# Convert to html
co_convert -t -d $pwr_doc $pwr_eexe/wtt_version_help.dat
{
echo "<html><head>"
echo "<meta http-equiv=\"Refresh\" content=\"5;../wtt_version_help_version.html\">"
echo "</head></html>"
} > $pwr_doc/en_us/package_version.html
if [ "$1" == "-v" ]; then
exit
fi
echo "-- Building pwr$ver"
packagename=pwr$ver-$version
pkgroot=$pwre_broot/$pwre_target/bld/pkg/$packagename
pkg_proot=$pwre_broot/$pwre_target/bld/pkg/$packagename/share/pwr$ver
# Create directories
echo "echo pwr$ver dummy" > $pkgroot/bin/pwr$ver
chmod a+x $pkgroot/bin/pwr$ver
mkdir -p $pkgroot/share/pwr$ver
mkdir -p $pkg_proot/usr/pwrp
mkdir -p $pkg_proot/etc
mkdir -p $pkg_proot/bin
echo "Start pwr$ver with command pwra" > $pkg_proot/share/pwr$ver/README
cp $pkgsrc/postinst $pkg_proot/install.site
find $pkg_proot -type d | xargs chmod 755
# copyright
cp $pkgsrc/copyright $pkg_proot/usr/share/doc/pwr$ver
# Man pages
mkdir -p $pkg_proot/usr/share/man/man1
cp $pkgsrc/pwr.1 $pkg_proot/usr/share/man/man1/pwr.1
gzip -fq --best $pkg_proot/usr/share/man/man1/pwr.1
# Copy proview
mkdir $pkg_proot/usr/pwr$ver
currentdir="`eval pwd`"
tarfile=$pwre_broot/$pwre_target/bld/pkg/pwrtmp.tar
cd $pwre_broot
echo "-- copy release to package tree"
tar -cf $tarfile $pwre_target/exp
cd $pkg_proot/usr/pwr$ver
tar -xf $tarfile
rm $tarfile
cd $currentdir
# Remove not needed libraries
rm $pkg_proot/usr/pwr$ver/$pwre_target/exp/lib/libpwr_flow.a
rm $pkg_proot/usr/pwr$ver/$pwre_target/exp/lib/libpwr_ge.a
rm $pkg_proot/usr/pwr$ver/$pwre_target/exp/lib/libpwr_glow.a
rm $pkg_proot/usr/pwr$ver/$pwre_target/exp/lib/libpwr_tlog.a
rm $pkg_proot/usr/pwr$ver/$pwre_target/exp/lib/libpwr_wb.a
rm $pkg_proot/usr/pwr$ver/$pwre_target/exp/lib/libpwr_xtt.a
# Copy configuration files to cnf
cp $pkgsrc/proview.cnf $pkg_proot/usr/pwr$ver/$pwre_target/exp/cnf
cp $pkgsrc/pwrp_profile $pkg_proot/etc
chmod a+x $pkg_proot/etc/pwrp_profile
# Copy adm files to cnf
cp $pwre_sroot/tools/pkg/deb/adm/pwr_setup.sh $pkg_proot/usr/pwr$ver/$pwre_target/exp/cnf
echo "pwrp set base V${ver:0:1}.${ver:1:1}" >> $pkg_proot/usr/pwr$ver/$pwre_target/exp/cnf/pwr_setup.sh
chmod a+x $pkg_proot/usr/pwr$ver/$pwre_target/exp/cnf/pwr_setup.sh
cp $pwre_sroot/tools/pkg/deb/adm/pwra_env.sh $pkg_proot/usr/pwr$ver/$pwre_target/exp/cnf
chmod a+x $pkg_proot/usr/pwr$ver/$pwre_target/exp/cnf/pwra_env.sh
cp $pwre_sroot/tools/pkg/deb/adm/pwr_volumelist.dat $pkg_proot/usr/pwr$ver/$pwre_target/exp/cnf
cp $pwre_sroot/tools/pkg/deb/adm/pwr_user2.dat $pkg_proot/usr/pwr$ver/$pwre_target/exp/cnf
cp $pwre_sroot/tools/pkg/deb/adm/proview_icon.png $pkg_proot/usr/pwr$ver/$pwre_target/exp/cnf
# Copy user to cnf
mkdir $pkg_proot/usr/pwr$ver/$pwre_target/exp/cnf/user
cp $pwre_sroot/tools/pkg/deb/user/.bashrc $pkg_proot/usr/pwr$ver/$pwre_target/exp/cnf/user
echo "source $aroot/db/pwr_setup.sh" >> $pkg_proot/usr/pwr$ver/$pwre_target/exp/cnf/user/.bashrc
cp $pwre_sroot/tools/pkg/deb/user/.bash_profile $pkg_proot/usr/pwr$ver/$pwre_target/exp/cnf/user
#cp $pwre_sroot/tools/pkg/deb/user/.mwmrc $pkg_proot/usr/pwr$ver/$pwre_target/exp/cnf/user
cp $pwre_sroot/tools/pkg/deb/user/.rtt_start $pkg_proot/usr/pwr$ver/$pwre_target/exp/cnf/user
cp $pwre_sroot/tools/pkg/deb/user/.xtt_start $pkg_proot/usr/pwr$ver/$pwre_target/exp/cnf/user
#cp $pwre_sroot/tools/pkg/deb/user/.xsession $pkg_proot/usr/pwr$ver/$pwre_target/exp/cnf/user
cp $pwre_sroot/tools/pkg/deb/user/wtt_init.pwr_com $pkg_proot/usr/pwr$ver/$pwre_target/exp/cnf/user
cp $pwre_sroot/tools/pkg/deb/user/wtt_init1.pwr_com $pkg_proot/usr/pwr$ver/$pwre_target/exp/cnf/user
# Generate desktop file
{
echo "[Desktop Entry]"
echo "Version=1.0"
echo "Encoding=UTF-8"
echo "Name=Proview V${version:0:3}"
echo "Type=Application"
echo "Comment=Start Proview"
echo "Exec=xterm -title \"Proview Development Console\" -e 'export pwra_db=$aroot/db;source \$pwra_db/pwra_env.sh set base V""${version:0:3}"";source \$pwra_db/pwra_env.sh set bus;wb -p pwrp pwrp'"
echo "Icon=$aroot/db/proview_icon.png"
echo "Categories=GNOME;GTK;Application;"
} > $pkg_proot/usr/pwr$ver/$pwre_target/exp/cnf/user/proview$ver.desktop
# Create package
echo "-- Building package"
cd $pwre_broot/$pwre_target/bld/pkg
tar -czf /usr/ports/distfiles/$packagename.tar.gz $packagename
mkdir -p /usr/ports/mystuff/misc/pwr$ver
cd /usr/ports/mystuff/misc/pwr$ver
cp $pkgsrc/Makefile .
make makesum
mkdir pkg
echo "Proview development and runtime package" > pkg/DESCR
if [ -e /usr/obj/ports/$pkgname ]; then
rm -r /usr/obj/ports/$pkgname
fi
make fake
make plist
make package
#rm -r $pgkroot
Proview V3.4b (3.4.1-1)
\ No newline at end of file
Package: pwr48
Version: 4.8.3
Section: base
Priority: optional
Architecture: i386
Depends: libc6 (>= 2.11.2-7), libgtk2.0-0 (>= 2.20.1-2), libasound2 (>= 1.0.23-2.1), libdb4.8 (>=4.8.30-2), libdb4.8++ (>= 4.8.30-2), libmysql++3 (>= 3.0.9-1+b1), g++ (>= 4:4.4.5-1)
Replaces: pwrrt,pwr34,pwr39,pwr40,pwr41,pwr42,pwr43,pwr44,pwr45,pwr46,pwr47
Maintainer: Proview <postmaster@proview.se>
Description: Proview development and runtime environment package
Proview development and runtime environment
4.8.0-1 Base release
4.8.1-1
- I/O support for Arduino USB board.
- Remote support for Websphere Message Queue.
- Operator event logging and replay.
- Chinese translation in operator environment.
4.8.1-2
- Profinet configurator, ordernumber showed in module enum list.
- Curve window, second mark and export dialog added.
- Profibus/Profinet configurator, default module class setting added, and Appl button added.
- Configurator fix, Delete, Create and Move object menu items were not insensive in view mode.
- Plc link, problem with uppercase nodename for opt-file fixed.
- Xtt, problems with OpPlace and XttGraph objects in SharedVolume fixed.
- Plc compile, problem with compile of component subwindows fixed.
- Wb object editor, Ctrl DoubleClick MB1 didn't work on attribute references.
- Flow alloc color problem fixed.
- wb locale fix for ubuntu.
4.8.2-1
- Support for Hilscher cifX boards.
- Support for Hilscher cifX Profinet Controller.
- UDP communication configured with IO objects.
- Support for USB joystick.
4.8.3-1
- Support for OpenBSD.
Proview
Copyright: SSAB Oxelsund AB <ssabox.com>
2003-11-21
The home page of Proview is at:
http://www.proview.se
#!/bin/sh
set -e
# ver=""
# pwre_target=""
echo "Here in postinst..."
# Automatically added by dh_installdocs
if [ "$1" = "configure" ]; then
if [ -d /usr/doc -a ! -e /usr/doc/pwrtest -a -d /usr/share/doc/pwrtest ]; then
ln -sf ../share/doc/pwrtest /usr/doc/pwrtest
fi
fi
# End automatically added section
aroot="/usr/pwrp/adm"
if getent group pwrp > /dev/null; then
echo "-- group pwrp already exist"
else
if groupadd pwrp; then
echo "-- group pwrp added"
fi
fi
if getent passwd pwrp > /dev/null; then
echo "-- user pwrp already exist"
else
new_user=1
if useradd -s /bin/bash -p aaupl/kQs1p3U -g pwrp -d /home/pwrp pwrp; then
echo "-- user pwrp added"
fi
if [ ! -e /home/pwrp ]; then
mkdir /home/pwrp
fi
cp /usr/pwr$ver/$pwre_target/exp/cnf/user/.bashrc /home/pwrp
cp /usr/pwr$ver/$pwre_target/exp/cnf/user/.bash_profile /home/pwrp
# cp /usr/pwr$ver/$pwre_target/exp/cnf/user/.mwmrc /home/pwrp
cp /usr/pwr$ver/$pwre_target/exp/cnf/user/.rtt_start /home/pwrp
chmod a+x /home/pwrp/.rtt_start
cp /usr/pwr$ver/$pwre_target/exp/cnf/user/.xtt_start /home/pwrp
chmod a+x /home/pwrp/.xtt_start
# cp /usr/pwr$ver/$pwre_target/exp/cnf/user/.xsession /home/pwrp
cp /usr/pwr$ver/$pwre_target/exp/cnf/user/wtt_init.pwr_com /home/pwrp
cp /usr/pwr$ver/$pwre_target/exp/cnf/user/wtt_init1.pwr_com /home/pwrp
chown -R pwrp /home/pwrp
chgrp -R pwrp /home/pwrp
fi
if [ ! -e /home/pwrp/Desktop ]; then
mkdir /home/pwrp/Desktop
fi
cp /usr/pwr$ver/$pwre_target/exp/cnf/user/proview$ver.desktop /home/pwrp/Desktop
chown pwrp:pwrp /home/pwrp/Desktop/proview$ver.desktop
chmod a+x /home/pwrp/Desktop/proview$ver.desktop
echo "Change owner of files to pwrp"
chown -R pwrp /usr/pwr$ver
chgrp -R pwrp /usr/pwr$ver
chmod u+s /usr/pwr$ver/$pwre_target/exp/exe/rt_ini
chmod u+s /usr/pwr$ver/$pwre_target/exp/exe/rt_rtt
chmod u+s /usr/pwr$ver/$pwre_target/exp/exe/rt_xtt
chmod u+s /usr/pwr$ver/$pwre_target/exp/exe/rt_bck
# Copy configuration files
new_cnf=0
if [ ! -e /etc/proview.cnf ]; then
cp /usr/pwr$ver/$pwre_target/exp/cnf/proview.cnf /etc
new_cnf=1
fi
# Add pwrp_profile to profile
if ! grep -q "/etc/pwrp_profile\b" /etc/profile; then
cat >> /etc/profile <<-EOF
if [ -e /etc/pwrp_profile ]; then
source /etc/pwrp_profile
fi
EOF
fi
# Create and copy adm
if [ ! -e $aroot/db ]; then
mkdir -p $aroot/db
fi
cp /usr/pwr$ver/$pwre_target/exp/cnf/pwra_env.sh $aroot/db
cp /usr/pwr$ver/$pwre_target/exp/cnf/pwr_setup.sh $aroot/db
cp /usr/pwr$ver/$pwre_target/exp/cnf/proview_icon.png $aroot/db
if [ ! -e $aroot/db/pwr_volumelist.dat ]; then
cp /usr/pwr$ver/$pwre_target/exp/cnf/pwr_volumelist.dat $aroot/db
fi
if [ ! -e $aroot/db/pwr_user2.dat ]; then
cp /usr/pwr$ver/$pwre_target/exp/cnf/pwr_user2.dat $aroot/db
fi
# Insert base in projectlist
if [ ! -e $aroot/db/pwr_projectlist.dat ]; then
echo "%base V${ver:0:1}.${ver:1:1} /usr/pwr$ver" > $aroot/db/pwr_projectlist.dat
else
set +e
ptst=`eval grep "^%base" $aroot/db/pwr_projectlist.dat | grep "\bV${ver:0:1}.${ver:1:1}\b"`
set -e
if [ "$ptst" = "" ]; then
echo "%base V${ver:0:1}.${ver:1:1} /usr/pwr$ver" >> $aroot/db/pwr_projectlist.dat
fi
fi
# Change group to pwrp
chgrp pwrp $aroot
chmod g+w $aroot
chgrp -R pwrp $aroot/*
chmod -R g+w $aroot/*
chmod a+w /usr/pwr$ver/$pwre_target/exp/load/*.dbs
# Create project root
if [ ! -e /usr/local/pwrp ]; then
mkdir /usr/local/pwrp
chgrp pwrp /usr/local/pwrp
chmod g+w /usr/local/pwrp
fi
#!/bin/sh
set -e
echo "Here in prerm..."
# Automatically added by dh_installdocs
if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/pwrtest ]; then
rm -f /usr/doc/pwrtest
fi
# End automatically added section
#
# Configuration file for Proview
#
# Default QCOM Bus Id
#
qcomBusId 999
#
# Web directory
#
webDirectory /var/www
#
# Default privileges for SevXtt: Read, Admin or None
#
sevXttDefaultPriv Read
PWR(1) Proview Manuals PWR(1)
NAME
pwr - start and stop Proview runtime environment
SYNOPSIS
pwr [start][stop]
DESCRIPTION
Start and stop command for Proview runtime environment.
OPTIONS
start Start Proview runtime environment.
stop Stop Proview runtime environment.
FILES
/etc/pwrp_profile
The system wide configuration file..
AUTHOR
Written by CS.
SEE ALSO
pwr(5)
Proview Last change: Nov 2003
bus_id=""
if [ -e /etc/proview.cnf ]; then
bus_id=`eval cat /etc/proview.cnf | grep "[[:<:]]qcomBusId[[:>:]]" | awk '{print $2}'`
fi
if [ -e /etc/proview.cnf ]; then
web_dir=`eval cat /etc/proview.cnf | grep "[[:<:]]bwebDirectory[[:>:]]" | awk '{print $2}'`
fi
export PWR_BUS_ID=$bus_id
export pwrb_root=/usr/pwrrt
export pwrp_root=/pwrp
export pwr_exe=$pwrb_root/exe
export pwr_lib=$pwrb_root/lib
export pwr_obj=$pwrb_root/obj
export pwr_inc=$pwrb_root/inc
export pwr_load=$pwrb_root/load
export pwr_lis=$pwrb_root/lis
export pwr_doc=$pwrb_root/doc
export pwrp_exe=$pwrp_root/x86_linux/exe
export pwrp_lib=$pwrp_root/x86_linux/lib
export pwrp_obj=$pwrp_root/x86_linux/obj
export pwrp_lis=$pwrp_root/x86_linux/lis
export pwrp_inc=$pwrp_root/common/inc
export pwrp_load=$pwrp_root/common/load
export pwrp_log=$pwrp_root/common/log
export pwrp_db=$pwrp_root/common/db
export pwrp_web=$web_dir
export pwra_db=/usr/pwrp/adm/db
jdk=`eval ls -t /usr/local | grep ^jdk`
if [ "$jdk" == "" ]; then
jdk=`eval ls -t /usr/local | grep ^jre`
fi
export jdk=/usr/local/$jdk
export jdk_home=$jdk/bin
PATH=$PATH:$pwr_exe:$pwrp_exe:$jdk_home
#Set display to remote computer
export DISPLAY=$REMOTEHOST:0.0
#symbols to define start/stop commands for PWR
alias pwr_stop='/etc/init.d/pwr stop'
alias pwr_stop.sh="/etc/init.d/pwr stop"
alias pwr_start="/etc/init.d/pwr start"
alias pwr="/etc/init.d/pwr"
alias boot="/usr/bin/sudo /sbin/reboot"
if [ -e $pwrp_exe/profile ]; then
source $pwrp_exe/profile
fi
include $(pwre_dir_symbols)
ifndef variables_mk
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/variables.mk
endif
ifndef variables_mk
include $(pwre_sroot)/tools/bld/src/$(os_name)/variables.mk
endif
ifndef rules_mk
-include $(pwre_sroot)/tools/bld/src/$(os_name)/$(hw_name)/rules.mk
endif
ifndef rules_mk
include $(pwre_sroot)/tools/bld/src/$(os_name)/rules.mk
endif
.SUFFIXES:
.PHONY : all init copy lib exe clean realclean \
$(clean_ge)
all : init copy lib exe
init : dirs
copy :
lib :
exe : $(bld_dir)/control_pwrrt $(bld_dir)/control_pwr $(bld_dir)/control_pwrdemo $(bld_dir)/control_pwrsev
clean :
realclean :
dirs : $(bld_dir)$(dir_ext)
$(bld_dir)$(dir_ext) :
@ $(mkdir) -p $(mkdirflags) $(basename $@)
$(bld_dir)/control_pwrrt : ../../../pwrrt/control
@ echo "build $(target)"
@ ../../../pwrrt/build.sh
@ cp $(source) $(target)
$(bld_dir)/control_pwr : ../../../pwr/control
@ echo "build $(target)"
@ ../../../pwr/build.sh
@ cp $(source) $(target)
$(bld_dir)/control_pwrdemo : ../../../pwrdemo/control
@ echo "build $(target)"
@ ../../../pwrdemo/build.sh
@ cp $(source) $(target)
$(bld_dir)/control_pwrsev : ../../../pwrsev/control
@ echo "build $(target)"
@ ../../../pwrsev/build.sh
@ cp $(source) $(target)
#!/bin/bash
#
# Startscript fr PWR av Ulf Ljungdahl
#
#test -x /sbin/ipchains || exit 0
#test -x /sbin/ipchains-restore || exit 0
#test -x /sbin/ipchains-save || exit 0
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
. /etc/pwrp_profile
save ()
{
echo -n "Saving IP chains: "
TEMPFILE="`tempfile`"
echo "${SAVEFILEHEADER}" >"${TEMPFILE}" && /sbin/ipchains-save >>"${TEMPFILE}" 2>/dev/null
cat "${TEMPFILE}" >/etc/ipchains.save
rm "${TEMPFILE}"
}
pwr_start()
{
$pwr_exe/rt_ini &
sleep 5
/usr/sbin/setrtprio `ps ax | grep "plc" | grep -v "grep" | awk '{ print $1}'`
}
pwr_stop()
{
kill -9 `ps ax | grep "rt_neth_acp" | awk '{ print $1}'`
kill -9 `ps ax | grep "rt_neth" | awk '{ print $1}'`
kill -9 `ps ax | grep "rt_qmon" | awk '{ print $1}'`
kill -9 `ps ax | grep "rt_emon" | awk '{ print $1}'`
kill -9 `ps ax | grep "rt_tmon" | awk '{ print $1}'`
kill -9 `ps ax | grep "rt_\|/pwr/exe/rs" | awk '{ print $1}'`
kill -9 `ps ax | grep "\[rt_" | awk '{ print $1}'`
kill -9 `ps ax | grep "plc_" | awk '{ print $1}'`
kill -9 `ps ax | grep "jpwr.rt" | awk '{ print $1}'`
kill -9 `ps ax | grep "rs_nmps" | awk '{ print $1}'`
kill -9 `ps ax | grep "rs_remote" | awk '{ print $1}'`
if [ -u $pwr_exe/rt_ini ]; then
user=`ls -al $pwr_exe/rt_ini | awk '{ print $3}'`
else
user=$USER
fi
echo "User $user"
eval `ipcs -s|grep ^0x|grep "[ \t]$user[ \t]"|awk '{printf "ipcrm sem %s;", $2
}'`
# remove message queues
eval `ipcs -q|grep ^0x|grep "[ \t]$user[ \t]"|awk '{printf "ipcrm msg %s;", $2
}'`
# remove shared memory
eval `ipcs -m|grep ^0x|grep "[ \t]$user[ \t]"|awk '{printf "ipcrm shm %s;", $2
}'`
if [ -e $pwrp_exe/pwrp_stop.sh ]; then
source $pwrp_exe/pwrp_stop.sh
fi
rm /tmp/pwr*$PWR_BUS_ID
#rm -f /tmp/pwr*
#id=`ipcs -s | grep $user | awk '{print $2}'`
#id1=`echo $id | awk '{print $1}'`
#id2=`echo $id | awk '{print $2}'`
#id3=`echo $id | awk '{print $3}'`
#ipcrm sem $id1
#ipcrm sem $id2
#ipcrm sem $id3
#id=`ipcs -q | grep $user | awk '{print $2}'`
#id1=`echo $id | awk '{print $1}'`
#id2=`echo $id | awk '{print $2}'`
#id3=`echo $id | awk '{print $3}'`
#ipcrm msg $id1
#ipcrm msg $id2
#ipcrm msg $id3
}
case "$1"
in
start)
echo "Startar PWR..."
#if [ 'test -x ps aux | grep plc | grep -v grep' ]
# then
# echo "PWR kr, stoppar det frst.."
# pwr_stop
# fi
pwr_start
echo "Klar."
;;
stop)
echo "Stoppar PWR..."
pwr_stop
# if [ "${SAVEONCE}" != "yes" ]
# then
# save
# echo -n "ipchains-save"
# else
# echo -n "Clearing IP chains:"
# fi
echo "Klar"
;;
restart)
echo "Startar om PWR."
echo "Stoppar det frst."
pwr_stop
sleep 1
echo "Startar igen."
pwr_start
echo "Klar."
;;
*)
echo "Usage:{start|stop|restart}" >&2
#echo "Ingen parameter angiven, startar PWR"
#$0 start
exit 1
;;
esac
exit 0
......@@ -176,13 +176,13 @@ pwre_get_variables()
{
local socket
socket=`eval cat /etc/proview.cnf | grep "\bmysql_socket\b" | awk '{print $2}'`
socket=`eval cat /etc/proview.cnf | grep "[[:<:]]mysql_socket[[:>:]]" | awk '{print $2}'`
if [ ! -z $socket ]; then
mysql_socket="--socket $socket"
fi
if [ -n $pwre_kroot ]; then
pwr_dbversion=`eval cat $pwre_kroot/exp/inc/src/pwr_version.h | grep "\bpwrv_cWbdbVersionShortStr\b" | awk '{print $3}'`
pwr_dbversion=`eval cat $pwre_kroot/exp/inc/src/pwr_version.h | grep "[[:<:]]pwrv_cWbdbVersionShortStr[[:>:]]" | awk '{print $3}'`
if [ -z $pwr_dbversion ]; then
echo "Unable to get pwr db version"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment