- #!/bin/sh
- ### need some variables
- . /opt/etc/system.var
- decodeversion="1.2.4"
- optversion="`cat /opt/OPT_VERSION`"
- echo " --> starting the integration script ${optversion}"
- ### only for root
- if [ "${USER}" = "root" ] || [ "${1}" = "--force" ]; then
- echo -n " --> actived make.conf "
- if [ ! -e /etc/make.conf ]; then
- ln -s /opt/etc/make.conf-system /etc/make.conf
- echo -e "${ISINSTALLED}"
- else
- echo -e "${NOTHINGTODO}"
- fi
- echo -n " --> installing firewall, without turn it on! "
- FIREWALL="YES"
- grep "firewall" /etc/rc.conf >/dev/null 2>&1 || FIREWALL="NO"
- if [ "${FIREWALL}" = "NO" ]; then
- echo '' >>/etc/rc.conf
- echo '###### Firewall ######'>>/etc/rc.conf
- echo 'firewall_enable="NO"' >>/etc/rc.conf
- echo 'firewall_script="/opt/bin/firewall"' >>/etc/rc.conf
- echo 'natd_enable="NO"' >>/etc/rc.conf
- echo 'natd_program="NO"' >>/etc/rc.conf
- echo 'natd_interface="re0"' >>/etc/rc.conf
- echo 'gateway_enable="NO"' >>/etc/rc.conf
- echo '## We need pf for jail-internet connections' >>/etc/rc.conf
- echo 'pf_enable="NO"' >>/etc/rc.conf
- echo 'pf_rules="/opt/etc/pf.conf"' >>/etc/rc.conf
- echo -e "${ISINSTALLED}"
- else
- echo -e "${NOTHINGTODO}"
- fi
- echo -n " --> installing JAIL support in rc.conf! "
- JAIL="YES"
- grep "jail_enable" /etc/rc.conf >/dev/null 2>&1 || JAIL="NO"
- if [ "${JAIL}" = "NO" ]; then
- echo '' >>/etc/rc.conf
- echo '###### JAILS ######' >>/etc/rc.conf
- echo 'jail_enable="NO"' >>/etc/rc.conf
- echo 'jail_list=""' >>/etc/rc.conf
- echo -e "${ISINSTALLED}"
- else
- echo -e "${NOTHINGTODO}"
- fi
- echo -n " --> installing JAIL configuration (jail.conf)! "
- if [ -h /etc/jail.conf ]; then
- echo -e "${NOTHINGTODO}"
- else
- ln -s /opt/etc/jail.conf /etc/jail.conf
- echo -e "${ISINSTALLED}"
- fi
- echo -n " --> installing decode-cgi V${decodeversion} for www shell scripts! "
- if [ -e /opt/bin/decode-cgi ]; then
- DECODE="NO"
- echo
- echo -n " ^--> find decode-cgi in /opt/bin <-- so i do nothing! "
- else
- DECODE="YES"
- cd /opt/src/decode-cgi-${decodeversion} || DECODE="NO"
- /usr/bin/make >/dev/null 2>&1 || DECODE="NO"
- mv /opt/src/decode-cgi-${decodeversion}/decode-cgi /opt/bin || DECODE="NO"
- /usr/bin/make clean >/dev/null 2>&1 || DECODE="NO"
- fi
- if [ "${DECODE}" = "YES" ]; then
- echo -e "${ISINSTALLED}"
- else
- echo -e "${NOTHINGTODO}"
- fi
- echo -n " --> create symlink /usr/home -> /home"
- if [ -h /home ]; then
- echo -e "${NOTHINGTODO}"
- else
- ln -s /usr/home /home
- echo -e "${ISINSTALLED}"
- fi
- echo -n " --> create symlink interfaces.sh -> /usr/local/etc/rc.d/..."
- if [ -h /usr/local/etc/rc.d/999interfaces.sh ]; then
- echo -e "${NOTHINGTODO}"
- else
- if [ ! -d "/usr/local/etc/rc.d" ]; then
- mkdir "/usr/local/etc/rc.d"
- fi
- ln -s /opt/bin/interfaces.sh /usr/local/etc/rc.d/999interfaces.sh
- echo -e "${ISINSTALLED}"
- fi
- echo -n " --> create symlink mergemaster.rc -> /etc"
- if [ -h /etc/mergemaster.rc ]; then
- echo -e "${NOTHINGTODO}"
- else
- ln -s /opt/etc/mergemaster.rc /etc/mergemaster.rc
- echo -e "${ISINSTALLED}"
- fi
- echo -n " --> create symlink mjail -> /bin"
- if [ -h /bin/mjail ]; then
- echo -e "${NOTHINGTODO}"
- else
- ln -s /opt/bin/mjail.sh /bin/mjail
- echo -e "${ISINSTALLED}"
- fi
- echo -n " --> create symlink adduser.conf -> /etc"
- if [ -h /etc/adduser.conf ]; then
- echo -e "${NOTHINGTODO}"
- else
- ln -s /opt/etc/adduser.conf /etc/adduser.conf
- echo -e "${ISINSTALLED}"
- fi
- echo -n " --> create symlink consolefax.sh -> /bin"
- if [ -h /bin/consolefax ]; then
- echo -e "${NOTHINGTODO}"
- else
- ln -s /opt/bin/consolefax.sh /bin/consolefax
- echo -e "${ISINSTALLED}"
- fi
- echo -n " --> actived german language support"
- checklogin="`/usr/bin/cmp /opt/etc/login.conf /etc/login.conf`"
- if [ -z "${checklogin}" ]; then
- echo -e "${NOTHINGTODO}"
- else
- cp /opt/etc/login.conf /etc/login.conf
- /usr/bin/cap_mkdb /etc/login.conf
- echo -e "${ISINSTALLED}"
- fi
- echo -n " --> installing PKG configuration (FreeBSD.conf)! "
- if [ -e /usr/local/etc/pkg/repos/FreeBSD.conf ]; then
- echo -e "${NOTHINGTODO}"
- else
- mkdir -p /usr/local/etc/pkg/repos >/dev/null 2>&1
- ln -s /opt/etc/FreeBSD.conf /usr/local/etc/pkg/repos/FreeBSD.conf
- echo -e "${ISINSTALLED}"
- fi
- ### END for user root
- fi
- ### for all users
- echo -n " --> make some changes in ~/.profile"
- INSTALLED="YES"
- grep "system.var" ~/.profile >/dev/null 2>&1 || INSTALLED="NO"
- if [ "${INSTALLED}" = "NO" ]; then
- sed -e 's/cons25}/cons25l1}/g' \
- -e 's/more/less/g' \
- <~/.profile >~/.profile.new \
- && echo '[ -n "${BASH}" ] && source /opt/etc/system.var && /opt/bin/interfaces.sh start' \
- >>~/.profile.new && mv ~/.profile.new ~/.profile \
- && INSTALLED="YES"
- if [ "${INSTALLED}" = "YES" ]; then
- echo -e "${ISINSTALLED}"
- else
- echo -e "${NOTHINGTODO}"
- fi
- else
- echo -e "${NOTHINGTODO}"
- fi
- if [ "${1}" = "--force" ]; then
- sed -e 's/cons25}/cons25l1}/g' \
- -e 's/more/less/g' \
- </root/.profile >/root/.profile.new \
- && echo '[ -n "${BASH}" ] && source /opt/etc/system.var && /opt/bin/interfaces.sh start' \
- >>/root/.profile.new && mv /root/.profile.new /root/.profile \
- && INSTALLED="YES"
- if [ "${INSTALLED}" = "YES" ]; then
- echo -e "${ISINSTALLED}"
- else
- echo -e "${NOTHINGTODO}"
- fi
- fi
- exit 0
- </code