Script as it is so far (not working):
#!/bin/bash
while read line
uname="cat /etc/passwd | grep bash | sed 's/:.*//'"
echo "config system admin
for each line $uname >
if $uname = "root" then
echo "skipping $uname 'root'" else
echo "edit '$uname'/n
set remote-auth enable/n
set trusthost1 8.8.8.8 255.255.255.255/n
set accprofile "admin"/n
set vdom "root"/n
set remote-group "foobar"/n
set password ENC potatoes/n
next/n" > output.txt
Output from "cat /etc/passwd | grep bash | sed 's/:.*//'"
foo
root
bar
Expected output in "output.txt" with three users listed in "/etc/password" being foo, root, and bar:
config system admin
edit foo
set remote-auth enable
set trusthost1 8.8.8.8 255.255.255.255
set accprofile "admin"
set vdom "root"
set remote-group "foobar"
set password ENC potatoes
next
edit bar
set remote-auth enable
set trusthost1 8.8.8.8 255.255.255.255
set accprofile "admin"
set vdom "root"
set remote-group "foobar"
set password ENC potatoes
next