
# Point your browser to http://configservice-url:8087:/dashboard
h3. Some useful linux scripts for ConfigService dashboard installations
*more /home/cs-dashboard/start-service.sh*
{code}
#!/bin/bash
# Used by https://github.com/Cantara/Whydah/tree/master/dev-quickstart
# If Version is from source, find the artifact
if [ "$Version" = "FROM_SOURCE" ]; then
# Find the bult artifact
Version=$(find target/* -name '*.jar' | grep SNAPSHOT | grep -v javadoc | grep -v original | grep -v lib)
else
Version=ConfigService-Dashboard.jar
fi
nohup /usr/bin/java $env_vars -jar $Version &
{code}
*more /home/cs-dashboard/update-service.sh*
{code}
#!/bin/bash
releaseRepo=http://mvnrepo.cantara.no/content/repositories/releases
snapshotRepo=http://mvnrepo.cantara.no/content/repositories/snapshots
groupId=no/cantara/csdb
artifactId=ConfigService-Dashboard
V=SNAPSHOT
if [[ $V == *SNAPSHOT* ]]; then
echo Note: If the artifact version contains "SNAPSHOT", the latest snapshot version is downloaded, ignoring the version before SNAPSHOT.
path="$snapshotRepo/$groupId/$artifactId"
version=`curl -s "$path/maven-metadata.xml" | grep "<version>" | grep "$V" | sed "s/.*<version>\([^<]*\)<\/version>.*/\1/" | tail -n 1`
#echo "version=$version, path=$path"
build=`curl -s "$path/$version/maven-metadata.xml" | grep '<value>' | head -1 | sed "s/.*<value>\([^<]*\)<\/value>.*/\1/"`
JARFILE="$artifactId-$build.jar"
url="$path/$version/$JARFILE"
else #A specific Release version
path="$releaseRepo/$groupId/$artifactId"
url=$path/$V/$artifactId-$V.jar
JARFILE=$artifactId-$V.jar
fi
# Download artifact
echo Downloading $url
wget -O $JARFILE -q -N $url
# Create symlink or replace existing sym link
if [ -h $artifactId.jar ]; then
unlink $artifactId.jar
fi
ln -s $JARFILE $artifactId.jar
# Delete old jar files
jar=$artifactId*.jar
nrOfJarFilesToDelete=`ls $jar -A1t | tail -n +6 | wc -l`
if [[ $nrOfJarFilesToDelete > 0 ]]; then
echo Deleting $nrOfJarFilesToDelete old jar files. Keep the 4 newest + the symlink.
ls $jar -A1t | tail -n +6 | xargs rm
fi
{code}
*more /etc/init/CS-Dashboard.conf*
{code}
# Ubuntu upstart file, http://upstart.ubuntu.com/cookbook/
description "ConfigService Upstart Configuration File"
author "baardl <bard.lind@gmail.com>"
start on runlevel [2345]
stop on runlevel [06]
script
su -c "nohup /usr/lib/jvm/java-1.8.0-openjdk.x86_64/bin/java -jar /home/cs-dashboard/configservice.jar" -s /bin/sh - cs-dashboard
end script
{code}
*/home/ec2-user/su_to_csd.sh*
{code}
#!/bin/sh
sudo su - cs-dashboard
{code}
*more /home/ec2-user/upgrade-CS-Dashboard.sh*
{code}
#!/bin/sh
# Manual script to upgrade and restart application.
sudo su -c "/home/cs-dashboard/update-service.sh" -s /bin/sh - cs-dashboard
sudo initctl stop CS-Dashboard
sudo initctl start CS-Dashboard
{code}
*more /home/ec2-user/restart-CS-Dashboard.sh*
{code}
#!/bin/sh
# Manual script to restart application.
#sudo pkill -u ConfigService -f ConfigService
sudo initctl stop CS-Dashboard
sudo initctl start CS-Dashboard
{code}