Skip to content

Instantly share code, notes, and snippets.

@lennartvdd
Created February 2, 2016 08:56
Show Gist options
  • Save lennartvdd/e4bd27cd1291b16751c1 to your computer and use it in GitHub Desktop.
Save lennartvdd/e4bd27cd1291b16751c1 to your computer and use it in GitHub Desktop.
Linux iSCSI: Change startup type from manual to automatic on all nodes, AND the default config
#!/bin/bash
set -e
if [[ $EUID -ne 0 ]]; then
echo "You must be a root user to run this script." 2>&1
exit 1
fi
find /etc/iscsi/ -type f | xargs grep -l "startup\s*=\s*manual" | xargs sed -i 's/\(startup\s*=\s*\)manual/\1automatic/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment