#!/bin/bash

# This is a sample USB enrollment configuration

# Configure the following in order
# MOTD
# Bash prompt
# Serial Ports
# NTP
# SNMP
# System Name and Time Zone
# NET1 Interface
# Cellular Modem
# Set root password to k1ng5man99 using encrypted hash
# Add admin user rey with password rey
# If the manifest.og contains enrollment statements, DO NOT run config -a or config -r in this file

cat >/etc/config/motd << 'EOF'
*******************************
Welcome to Opengear Demo Unit 1
******************************* 

EOF


cat >/etc/config/profile << 'EOF'

export PS1='[\u@\h]\$ '

EOF

chmod +x /etc/config/profile


config \
-s 'config.ports.port2.charsize=8' \
-s 'config.ports.port2.dtrmode=alwayson' \
-s 'config.ports.port2.flowcontrol=None' \
-s 'config.ports.port2.label=Cisco' \
-s 'config.ports.port2.loglevel=0' \
-s 'config.ports.port2.parity=None' \
-s 'config.ports.port2.pinout=X2' \
-s 'config.ports.port2.protocol=RS232' \
-s 'config.ports.port2.speed=9600' \
-s 'config.ports.port2.ssh=on' \
-s 'config.ports.port2.stop=1' \
-s 'config.ports.port2.syslog.facility=Default' \
-s 'config.ports.port2.syslog.priority=Default' \
-s 'config.ports.port2.terminal=vt220' \
-s 'config.ports.port3.charsize=8' \
-s 'config.ports.port3.dtrmode=alwayson' \
-s 'config.ports.port3.flowcontrol=None' \
-s 'config.ports.port3.label=ACM7004-5-LMP' \
-s 'config.ports.port3.loglevel=0' \
-s 'config.ports.port3.parity=None' \
-s 'config.ports.port3.pinout=X2' \
-s 'config.ports.port3.protocol=RS232' \
-s 'config.ports.port3.speed=115200' \
-s 'config.ports.port3.ssh=on' \
-s 'config.ports.port3.stop=1' \
-s 'config.ports.port3.syslog.facility=Default' \
-s 'config.ports.port3.syslog.priority=Default' \
-s 'config.ports.port3.terminal=vt220' \
-s 'config.ports.port4.charsize=8' \
-s 'config.ports.port4.device.type=rpc' \
-s 'config.ports.port4.dtrmode=alwayson' \
-s 'config.ports.port4.flowcontrol=None' \
-s 'config.ports.port4.label=IP Power 9258' \
-s 'config.ports.port4.loglevel=0' \
-s 'config.ports.port4.mode=portmanager' \
-s 'config.ports.port4.parity=None' \
-s 'config.ports.port4.pinout=X2' \
-s 'config.ports.port4.power.log.enabled=on' \
-s 'config.ports.port4.power.log.interval=15' \
-s 'config.ports.port4.power.name=PDU1' \
-s 'config.ports.port4.power.outlets=4' \
-s 'config.ports.port4.power.type=IP Power 9258 via RS232' \
-s 'config.ports.port4.protocol=RS232' \
-s 'config.ports.port4.speed=19200' \
-s 'config.ports.port4.stop=1' \
-s 'config.ports.port4.syslog.facility=Default' \
-s 'config.ports.port4.syslog.priority=Default' \
-s 'config.ports.port4.terminal=vt220' \
-s 'config.ntp.enabled=on' \
-s 'config.ntp.servers.server1.address=au.pool.ntp.org' \
-s 'config.ntp.servers.server1.key_id=0' \
-s 'config.ntp.servers.total=1' \
-s 'config.services.snmp.enabled=on' \
-s 'config.services.snmp.protocol=UDP' \
-s 'config.services.snmp.roauthprotocol=SHA' \
-s 'config.services.snmp.rocommunity=public' \
-s 'config.services.snmp.roprivprotocol=DES' \
-s 'config.services.snmp.syscontact=admin@opengear.com' \
-s 'config.services.snmp.syslocation=Brisbane Office' \
-s 'config.system.name=og-demo1' \
-s 'config.system.timezone=Australia/Brisbane' \
-s 'config.interfaces.wan.ddns.provider=none' \
-s 'config.interfaces.wan.ipv6.mode=stateless' \
-s 'config.interfaces.wan.media=Auto' \
-s 'config.interfaces.wan.mode=dhcp' \
-s 'config.cellmodem.ddns.provider=none' \
-s 'config.cellmodem.dialout.primary_sim=-1' \
-s 'config.cellmodem.ppp.dialer.enabled=on' \
-s 'config.cellmodem.sims.sim1.ppp.dialer.apn=telstra.internet' \
-s 'config.cellmodem.sims.sim1.ppp.dialer.password=corp-pass1' \
-s 'config.cellmodem.sims.sim1.ppp.dialer.username=corp-user1' \
-s 'config.users.user1.password=$1$yVQeWuCk$3dD67wpLDpZslY5oUiIkY.' \
-s 'config.users.user2.password=$1$HVFSI8hI$rqn6svJu3NPLlabBVmd6v/' \
-s 'config.users.user2.groups.group1=admin' \
-s 'config.users.user2.username=rey' \
-s 'config.users.total=2'