Slackware Basic Script Helpers

by jkwood
2 deployments · 0 still active · last rev. 5 years ago

Not intended to be deployed on Linodes.

This is a port of http://www.linode.com/stackscripts/view/?StackScriptID=1 using Slackware functions instead of Debian or Ubuntu. This functionality should be useful to those writing StackScripts aimed at the Slackware platform.

Compatible with: No distros currently supported
						#!/bin/bash
#
# Written by JK Wood <jk@slaxer.com>
# Inspired in part by http://www.linode.com/stackscripts/view/?StackScriptID=1
#
###########################################################
# System
###########################################################

function system_update {
	slackpkg -batch=on -default_answer=y update
	slackpkg -batch=on -default_answer=y upgrade-all
}

function system_primary_ip {
	# returns the primary IP assigned to eth0
	echo $(ifconfig eth0 | awk -F: '/inet addr:/ {print $2}' | awk '{ print $1 }')
}

function system_get_version {
        # This is the "official" Slackware version, and can be
        # used in things like Slackware mirror paths
        echo $(cat /etc/slackware-version | cut -d\  -f 2 | cut -d. -f 1,2)
}