Skip to content

Instantly share code, notes, and snippets.

@umardx
Last active April 16, 2017 09:25
Show Gist options
  • Save umardx/f1be02ebe775f2c080066af844013650 to your computer and use it in GitHub Desktop.
Save umardx/f1be02ebe775f2c080066af844013650 to your computer and use it in GitHub Desktop.

Stable Version

1- Install Dependensi Package.

apt-get install -y checkinstall build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev sudo unzip redis-server mongodb libsqlite3-dev curl joe tmux

2- Compile dan Install Ruby 2.3.4 # Ref : https://www.ruby-lang.org/en/downloads/

cd /opt

wget https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.4.tar.gz

tar -zxvf ruby-2.3.4.tar.gz

cd ruby-2.3.4

./configure

make

make install

gem install rails

gem install bundle --pre

3- Compile dan Install Node 0.12.18 # Ref : https://nodejs.org/download/release/

cd /opt

wget https://nodejs.org/download/release/v0.12.18/node-v0.12.18.tar.gz

tar -xzvf node-v0.12.18.tar.gz

cd node-v0.12.18

./configure

make

make install

4- Install GenieACS stable 1.0.7

cd /opt

wget https://github.com/zaidka/genieacs/releases/download/v1.0.7/genieacs-1.0.7.tgz

tar -xzvf genieacs-1.0.7.tgz

mv package genieacs

cd genieacs

npm install

npm run configure

5- Install GenieACS GUI stable v1.0

cd /opt

wget https://github.com/zaidka/genieacs-gui/archive/v1.0.zip

unzip v1.0.zip

mv genieacs-gui-1.0 genieacs-gui

cd genieacs-gui

bundle update

cp config/graphs-sample.json.erb config/graphs.json.erb

cp config/index_parameters-sample.yml config/index_parameters.yml

cp config/summary_parameters-sample.yml config/summary_parameters.yml

cp config/parameters_edit-sample.yml config/parameters_edit.yml

cp config/parameter_renderers-sample.yml config/parameter_renderers.yml

cp config/roles-sample.yml config/roles.yml

cp config/users-sample.yml config/users.yml

Sampai pada step terakhir di atas, genieacs telah selesai diinstall. Untuk membuat startup/stop script dapat melakukan langkah berikut.

cd /opt
cat << EOF > ./genieacs-start.sh
#!/bin/sh
if tmux has-session -t 'genieacs'; then
  echo "GenieACS is already running."
  echo "To stop it use: ./genieacs-stop.sh"
  echo "To attach to it use: tmux attach -t genieacs"
else
  tmux new-session -s 'genieacs' -d
  tmux send-keys './genieacs/bin/genieacs-cwmp' 'C-m'
  tmux split-window
  tmux send-keys './genieacs/bin/genieacs-nbi' 'C-m'
  tmux split-window
  tmux send-keys './genieacs/bin/genieacs-fs' 'C-m'
  tmux split-window
  tmux send-keys 'cd genieacs-gui' 'C-m'
  tmux send-keys 'rails server' 'C-m'
  tmux select-layout tiled 2>/dev/null
  tmux rename-window 'GenieACS'

  echo "GenieACS has been started in tmux session 'geneiacs'"
  echo "To attach to session, use: tmux attach -t genieacs"
  echo "To switch between panes use Ctrl+B-ArrowKey"
  echo "To deattach, press Ctrl+B-D"
  echo "To stop GenieACS, use: ./genieacs-stop.sh"
fi
EOF

cat << EOF > ./genieacs-stop.sh
#!/bin/sh
if tmux has-session -t 'genieacs' 2>/dev/null; then
  tmux kill-session -t genieacs 2>/dev/null
  echo "GenieACS has been stopped."
else
  echo "GenieACS is not running!"
fi
EOF

chmod +x genieacs-start.sh genieacs-stop.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment